/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package function;

import engine.goods.Goods;
import java.io.DataInputStream;
import java.io.InputStream;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import mainpackage.Constant;
import mainpackage.GameBean;
import mainpackage.InputInterFace;
import mainpackage.LocalMsgManager;
import mainpackage.MainCanvas;
import mainpackage.MainGame;
import mainpackage.MainLogic;
import mainpackage.ResManager;
import mainpackage.Rms;
import mainpackage.Tools;
import ui.UiLogin;

/**
 * 通用的系统信息提示
 * @author foonwayx
 */
public class SysMessage {

    private String sMess = null;
    private String sTitle = null;
    public static byte byKeyState = -1; //在弹出层的界面，需要用户按下确认和取消操作，记录用户的按键状态,1 为确认，0：取消；-1为无
    public byte byPopUpState = -1;
    int iWidth;
    int iHeight;
    int iStartX;
    int iStartY;
    private Image[] imgArray;
    private byte byNextUiState = -1;
    private byte bAutoDisappear = 0;
    public static boolean bShowPopUpMessage = false;
    private long lLastSysTime = 0L;

    /*************************************弹出层显示提示信息*********************************
     * @param title :标题
     * @param message： 内容
     * @param autoDisappear： 是否自动的消失 1是自动消失 0 为非自动消失
     * @param byNextUiState ：下一个界面的UI
     */
    public void showMessage(String title, String message, byte bAutoDisappear, byte byNextUiState, int iOffsetX, int iOffsetY) {
        this.bAutoDisappear = bAutoDisappear;
        this.byNextUiState = byNextUiState;
        this.sTitle = title;
        this.sMess = "  " + message;
        this.bShowPopUpMessage = true;
        //#if NOKIA_S40V3 || NORMAL_240_400 || MOTO || K790
//#         this.byPopUpState = 4;
        //#else
        this.byPopUpState = 1;
        //#endif
        this.initShowMessage(iOffsetX, iOffsetY);
    }

    public void showMessage(String title, String message, byte bAutoDisappear, byte byNextUiState) {
        showMessage(title, message, bAutoDisappear, byNextUiState, 0, 0);
    }

    public void showMessage(String title, String message) {
        showMessage(title, message, (byte) 0, (byte) -1, 0, 0);
    }

    /**
     * 初始化弹出提示菜单
     * @param iOffsetX
     * @param iOffsetY 
     */
    public void initShowMessage(int iOffsetX, int iOffsetY) {
        //#if NOKIA_S60V5
         this.iWidth = 310;
         this.iHeight = 120;
        //#else
//#        this.iWidth = 232;
//#        this.iHeight = 100;
        //#endif
        this.byKeyState = -1;
        if (this.sMess != null && this.sMess.length() > 0) {
            int iTextHeight = Tools.getParagraphHeight(sMess, this.iWidth - 20, Constant.FONT_SMALL_HEIGHT);
            if (iTextHeight > 50) {
                this.iHeight = this.iHeight + (iTextHeight - 50);
            }
        }
        this.iStartX = Constant.UI_START_X + ((Constant.SCREEN_WIDTH - this.iWidth) >> 1) + iOffsetX;
        //#if NOKIA_S60V5
         this.iStartY = Constant.UI_START_X + ((Constant.END_LINE - this.iHeight) >> 1) + iOffsetY;
        //#else
//#        this.iStartY = Constant.UI_START_X + ((Constant.SCREEN_HEIGHT - this.iHeight) >> 1) + iOffsetY;
        //#endif
        try {
            //弹出层的图片数组
            //#if NOKIA_S60V5
             switch (MainLogic.getInstance().byGameState) {
                 case Constant.GAME_UI_ROAM:
                     this.imgArray = new Image[6];
                     this.imgArray[3] = ResManager.createImage(90000043);
                     this.imgArray[4] = ResManager.createImage(90000086);
                     this.imgArray[5] = ResManager.createImage(90000090);
                     break;
                 default:
                     this.imgArray = new Image[6];
                     this.imgArray[3] = ResManager.createImage(90000043);
                     this.imgArray[4] = ResManager.createImage(90000086);
                     this.imgArray[5] = ResManager.createImage(90000090);
                     break;
             }
            //#else
//#            this.imgArray = new Image[3];
            //#endif
            if (GameBean.BY_TYPECOL_SHOWMESSAGE == 2) {
                //#if NOKIA_S60V5
                 this.imgArray[0] = Tools.makeTransparent(ResManager.createImage(90000053), 255);
                 //透明度
                 this.imgArray[1] = Tools.makeTransparent(10, this.iHeight + this.iHeight / 10, 220, 0x93b2ce);
                //#else
//#                this.imgArray[0] = Tools.makeTransparent(ResManager.createImage(90000077), 220);
//#                //透明度
//#                this.imgArray[1] = Tools.makeTransparent(10, this.iHeight + this.iHeight / 10, 220, 0x53b0ff);
                //#endif

            } else {
                this.imgArray[0] = Tools.makeTransparent(ResManager.createImage(90000051), 220);
                //透明度
                this.imgArray[1] = Tools.makeTransparent(10, this.iHeight + this.iHeight / 10, 220, 0x989898);
            }
            this.imgArray[2] = ResManager.createImage(90000044, Constant.RES_PUBLIC_TEMP, Constant.RES_UI_PATH, false, -1);
            GameBean.BY_TYPECOL_SHOWMESSAGE = -1;
        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
//            System.out.print("弹出层图片载入异常");
        }
    }

    /**
     * 更新弹出提示菜单层逻辑
     */
    public void updateShowMessage() {
        //提示框状态变化
        if (this.bAutoDisappear == 0) {
            if (this.byPopUpState < 4) {
                this.byPopUpState++;
            } else {
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)) {
                    //提示框按键
                    this.bShowPopUpMessage = false;
                    this.byKeyState = 1; //确认
                    if (this.byNextUiState > -1) {
                        MainLogic.getInstance().pushState(byNextUiState, true);
                    }
                    //倒计时宝箱
                    if (QuickOption.byBoxShowType == 2) {
                        QuickOption.byBoxShowType = 3;
                        GameBean.BY_CMD_COUNTBOX_TYPE = QuickOption.byBoxType;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_COUNT_BOX, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                    //可增加消息的逻辑处理类型可处理按键
                    if (GameBean.BY_CMD_INVITE_TONG_TYPE == 2) {//同意加入帮派
                        GameBean.BY_CMD_JION_TONG_CONFERM = 1;
                        MainLogic.getInstance().gamePlayer.sTongName = "[" + GameBean.STR_CMD_TONG_NO + "]";
                        MainLogic.getInstance().gamePlayer.bTongDuty = 0;
                        MainLogic.getInstance().gamePlayer.lTongId = GameBean.L_CMD_TONG_ID;
                        GameBean.STR_CMD_TONG_NO = null;
                        GameBean.L_CMD_TONG_ID = -1;
                        MainLogic.getInstance().send(Constant.MSG_NET_INVITE_TONG, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                    if (GameBean.BY_CMD_TONG_DIMISS == 1) {//解散帮派
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_TONG_DISMISS, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                    if (GameBean.BY_CMD_FRIEND_MODE == 2) {//确定添加对方为好友
                        GameBean.BY_CMD_FRIEND_TYPE = 1;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_ADD_FRIEND, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                    if (GameBean.BY_SCENE_POPUP == 1) {//确定离开副本
                        GameBean.BY_SCENE_POPUP = -1;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_FUNC_SEND, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                    //快速注册修改密码
                    if (GameBean.I_SYSTEM_MESSAGE_TYPE == 2) {
//                        System.out.println("mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm");
                        //非联网下本地测试
                        Rms.loadGame(Constant.RMS_LOGIN_USENAME_PASSWORD);
//                        GameBean.STR_CMD_LOGIN_USENAME = MainLogic.getInstance().uiLogin.sArray[0];//"idtu4t5q";
//                        GameBean.STR_CMD_LOGIN_PASSWORD = MainLogic.getInstance().uiLogin.sArray[1];//"Je6HR34x";STR_CMD_LOGIN_PASSWORD
                        //#if USER_CENTER=="TRUE"
                        //#if NOKIA_S40V3 || NORMAL_240_400 || MOTO || K790
//#                         //MainLogic.getInstance().pushState(Constant.GAME_UI_SERVER_LIST, true);
                        //#endif

//                        LocalMsgManager.sendHttpRequest(Constant.USER_CENTER_IP + "do=checkAccount&user_id="
//                                + GameBean.STR_CMD_LOGIN_USENAME + "&password=" + GameBean.STR_CMD_LOGIN_PASSWORD,
//                                false, (byte) 0);
                        LocalMsgManager.getInstance().httpConnect(Constant.MSG_LOCAL_HTTP_LOGIN);
                        //#else
//#                         //测试用
//# //                                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_SOCKET_START, Constant.SOCKET_MSG_TYPE_LOGIC);
//#                         MainLogic.getInstance().send(Constant.MSG_NET_CMD_LOGIN, Constant.SOCKET_MSG_TYPE_LOGIC);
                        //#endif
                        //#if USER_CENTER=="TRUE"
                        //#else
//#                         MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 65;
//#                         MainLogic.getInstance().uiInterFace.setGameNextState(Constant.GAME_UI_CREATE_ROLE);
//#                         MainLogic.pushState(Constant.GAME_UI_LOADING, false);
                        //#endif
                        GameBean.I_SYSTEM_MESSAGE_TYPE = -1;
                    } else if (GameBean.I_SYSTEM_MESSAGE_TYPE == 1) {
                        Rms.loadGame(Constant.RMS_LOGIN_USENAME_PASSWORD);
//                         GameBean.STR_CMD_LOGIN_USENAME
//                    GameBean.STR_CMD_LOGIN_USENAME = MainLogic.getInstance().uiLogin.sArray[0];
//                    GameBean.STR_CMD_LOGIN_PASSWORD = MainLogic.getInstance().uiLogin.sArray[1];
                        MainLogic.inputInterFace.setInputInterFace((byte) 5, "请输入新密码");
                        MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
                        GameBean.I_SYSTEM_MESSAGE_TYPE = -1;
                    } else if (GameBean.I_SYSTEM_MESSAGE_TYPE == 3) {//注册
                        //#if USER_CENTER=="TRUE"
                        LocalMsgManager.getInstance().httpConnect(Constant.MSG_LOCAL_HTTP_LOGIN);
                        //#else
//#                         MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 65;
//#                         MainLogic.getInstance().uiInterFace.setGameNextState(Constant.GAME_UI_CREATE_ROLE);
//#                         MainLogic.pushState(Constant.GAME_UI_LOADING, false);
                        //#endif

                    } else if (GameBean.I_SYSTEM_MESSAGE_TYPE == 4) {
//                         GameBean.STR_CMD_LOGIN_USENAME
//                    GameBean.STR_CMD_LOGIN_USENAME = MainLogic.getInstance().uiLogin.sArray[0];
//                    GameBean.STR_CMD_LOGIN_PASSWORD = MainLogic.getInstance().uiLogin.sArray[1];
                        MainLogic.inputInterFace.setInputInterFace((byte) 0, "请输入登录用户名和密码");
                        MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
                        GameBean.I_SYSTEM_MESSAGE_TYPE = -1;
                    } else if (GameBean.I_SYSTEM_MESSAGE_TYPE == 5) {//技能学习快捷提示
                        MainLogic.gamePlayer.runPathFinderForMission(GameBean.STR_CMD_LEARN_SKILL_KEY, GameBean.SH_CMD_LEARN_SKILL_POSX, GameBean.SH_CMD_LEARN_SKILL_POSY);
                        GameBean.STR_CMD_LEARN_SKILL_KEY = null;
                        GameBean.SH_CMD_LEARN_SKILL_POSX = -1;
                        GameBean.SH_CMD_LEARN_SKILL_POSY = -1;
                    } else if (GameBean.I_SYSTEM_MESSAGE_TYPE == 6) {//
//                        MainLogic.getInstance().exitGame();
//                        MainLogic.getInstance().pushState(Constant.GAME_UI_SET, true);
//                        MainLogic.getInstance().uiLogin.byUiState = 2;
//                        GameBean.BY_PRE_GAME_UI_STATE = -1;
                    	 //提示框按键
                        this.bShowPopUpMessage = false;
                        this.byKeyState = 0; //取消
                        if (this.byNextUiState > -1) {
                            MainLogic.getInstance().pushState(this.byNextUiState, true);
                        }
                    }
                    GameBean.I_SYSTEM_MESSAGE_TYPE = -1;
                    MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
                    this.clearShowMessage();
//                    if (!MainLogic.getInstance().uiInterFace.overNewPlayer[1]
//                            && GameBean.STR_CMD_QUEST_KEY.equals("1000")) {
//                        GameBean.BY_TYPECOL_SHOWMESSAGE = 2;
//                        GameBean.BY_STATE_NEWPLAYER = 1;
//                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("引导", MainLogic.getInstance().uiInterFace.strNewPlayer[1]);
//                        MainLogic.getInstance().uiInterFace.updateNewPlayer(1);
//                    }
                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {
                    //提示框按键
                    this.bShowPopUpMessage = false;
                    this.byKeyState = 0; //取消
                    if (this.byNextUiState > -1) {
                        MainLogic.getInstance().pushState(this.byNextUiState, true);
                    }
                    //倒计时宝箱
                    if (QuickOption.byBoxShowType == 2) {
                        QuickOption.byBoxShowType = 3;
                        GameBean.BY_CMD_COUNTBOX_TYPE = QuickOption.byBoxType;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_COUNT_BOX, Constant.SOCKET_MSG_TYPE_LOGIC);
                    } else if (GameBean.BY_CMD_INVITE_TONG_TYPE == 2) {//不同意加入帮派
                        GameBean.BY_CMD_JION_TONG_CONFERM = 0;
                        GameBean.STR_CMD_TONG_NO = null;
                        MainLogic.getInstance().send(Constant.MSG_NET_INVITE_TONG, Constant.SOCKET_MSG_TYPE_LOGIC);
                        Tools.printLog("---------不同意");
                    } else if (GameBean.I_SYSTEM_MESSAGE_TYPE == 5) {//技能学习快捷提示
                        GameBean.STR_CMD_LEARN_SKILL_KEY = null;
                        GameBean.SH_CMD_LEARN_SKILL_POSX = -1;
                        GameBean.SH_CMD_LEARN_SKILL_POSY = -1;
                    } else if (GameBean.BY_CMD_TONG_DIMISS == 1) {//取消解散帮派
                        GameBean.BY_CMD_TONG_DIMISS = -1;
                    }
                    if (GameBean.BY_CMD_FRIEND_MODE == 2) {//取消添加对方为好友
                        GameBean.BY_CMD_FRIEND_MODE = -1;
                    } else if (GameBean.BY_SCENE_POPUP == 1) {
                        MainLogic.getInstance().gamePlayer.bPopUp = true;
                        GameBean.BY_SCENE_POPUP = -1;
                    }
                    GameBean.I_SYSTEM_MESSAGE_TYPE = -1;
                    MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
                    this.clearShowMessage();
                }
            }
        } else {
            if (this.bAutoDisappear == 1) {
                if (this.byPopUpState < 4) {
                    this.byPopUpState++;
                } else {
                    this.bAutoDisappear = 2;
                    this.lLastSysTime = System.currentTimeMillis();
                }
            } else {
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)) {
                    //提示框按键
                    this.bShowPopUpMessage = false;
                    this.byKeyState = 1; //确认
                    if (this.byNextUiState > -1) {
                        MainLogic.getInstance().pushState(byNextUiState, true);
                    }
                    MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
                    this.clearShowMessage();
                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {
                    //提示框按键
                    this.bShowPopUpMessage = false;
                    this.byKeyState = 0; //取消
                    if (this.byNextUiState > -1) {
                        MainLogic.getInstance().pushState(this.byNextUiState, true);
                    }
                    MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
                    this.clearShowMessage();
                } else {
                    if (this.bAutoDisappear == 2) {
                        if (System.currentTimeMillis() - this.lLastSysTime > 3000) {
                            this.bAutoDisappear = 3;
                        }
                    } else if (this.bAutoDisappear == 3) {
                        this.bShowPopUpMessage = false;
                        this.byKeyState = 1; //确认
                        if (this.byNextUiState > -1) {
                            MainLogic.getInstance().pushState(byNextUiState, true);
                        }
                        MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
                        this.clearShowMessage();
//                        if (this.byPopUpState > 1) {
//                            this.byPopUpState--;
//                        } else {
//                            this.bShowPopUpMessage = false;
//                            this.byKeyState = 1; //确认
//                            if (this.byNextUiState > -1) {
//                                MainLogic.getInstance().pushState(byNextUiState, true);
//                            }
//                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
//                            this.clearShowMessage();
//                        }
                    }
                }
            }
        }
        MainCanvas.clearInput();
    }

    /**
     * 绘制弹出提示菜单层界面
     * @param g 
     */
    public void drawShowMessage(Graphics g) {
        if (imgArray[0] != null) {
        	Tools.drawAlphaBG(g);
            //#if NOKIA_S60V5
             if (GameBean.BY_CMD_INVITE_TONG_TYPE == 2) {
                 Tools.drawPopUp(g, this.byPopUpState, this.iStartX, this.iStartY, this.iWidth, this.iHeight, imgArray[0], imgArray[1], (byte) 1, imgArray[2], 64, 0, 22, 10, imgArray[2], 43, 0, 21, 10, this.sTitle, this.sMess);
             } else {
                 Tools.drawPopUp(g, this.byPopUpState, this.iStartX, this.iStartY, this.iWidth, this.iHeight, imgArray[0], imgArray[1], (byte) 1, imgArray[2], 22, 0, 21, 10, imgArray[2], 0, 0, 22, 10, this.sTitle, this.sMess);
             }
             Tools.drawBottom(g, this.imgArray[3], this.imgArray[5], this.imgArray[4]);
            //#else
//#            if (GameBean.BY_CMD_INVITE_TONG_TYPE == 2) {
//#                Tools.drawPopUp(g, this.byPopUpState, this.iStartX, this.iStartY, this.iWidth, this.iHeight, imgArray[0], imgArray[1], (byte) 1, imgArray[2], 43, 0, 21, 10, imgArray[2], 64, 0, 22, 10, this.sTitle, this.sMess);
//#            } else {
//#                Tools.drawPopUp(g, this.byPopUpState, this.iStartX, this.iStartY, this.iWidth, this.iHeight, imgArray[0], imgArray[1], (byte) 1, imgArray[2], 0, 0, 22, 10, imgArray[2], 22, 0, 21, 10, this.sTitle, this.sMess);
//#            }
            //#endif
        }
    }

    /**
     * 清除弹出提示信息资源
     */
    public void clearShowMessage() {
        this.sMess = null;
        this.sTitle = null;
        this.bAutoDisappear = -1;
        this.iHeight = -1;
        this.iWidth = -1;
        this.imgArray = null;
        this.byPopUpState = -1;
        this.byNextUiState = -1;
    }

    /**
     * 读取一个文本文件中的类容
     * @param path  文件位置
     * @param iplace 位置
     * @return  
     */
    public String readTXT(String path, char chCutOff, int iPlace, short byteSize) {
        if (iPlace < 1) {
            return null;
        }
        try {
            InputStream in;
            in = this.getClass().getResourceAsStream(path);
            DataInputStream is = new DataInputStream(in);
            int m;
            int num = 0;
            byte[] byStingChar = null;
            while ((m = is.read()) != -1) {
                if (m == -1) {
                    break;
                }
                if ((char) m == chCutOff) {
                    num++;
                    if (num == iPlace) {
                        byStingChar = new byte[byteSize];
                        is.read(byStingChar);
                        break;
                    }
                }
            }
            if (null == byStingChar) {
                return null;
            }
            String help = new String(byStingChar, "UTF-8");
            int endPos = help.indexOf(chCutOff);
            if (endPos != -1) {
                help = help.substring(0, endPos);
            }
            byStingChar = null;
            in.close();
            is = null;
            in = null;
            return help;
        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
            Tools.printLog("我读文件异常了");
            return null;
        }
    }
    /***********************查看物品,对比装备，装备道具，卸载道具****************************/
    public static boolean bShowCheckItem = false;
    private byte byHoleNum;
    private byte byGemNum;
    private String[] sGoodsDetail;//物品细节
    private String sGoodsDesc;//物品描述
    private Image[] detailImg = null;
    private byte byDetailPageIndex;
    private byte byMaxDetailPage;
    private short shHeight;
    private int shWidth;
    private byte[] byHoleState;
    private boolean bShowHole = false;
    private String sItemName = null;
    private byte byItemColor = -1;
    private Image itemIcon;
//    private String[][] sAttribute;
    private byte byCheckType;
    private String sdetailTitle;
    private int iTotalLine = -1;
    private short shGemStart;
    //#if NOKIA_E72
//#     private final static byte BY_LINE_PER_PAGE = 9;
    //#else
    private final static byte BY_LINE_PER_PAGE = 11;
    //#endif

    /**
     * 通过物品的ID查看物品
     * @param lItemsID 
     */
    public void checkItem(String sItemName, byte byItemColor, Image itemIcon, long lPlayerID, long lItemSlotkeyID) {
        this.sItemName = sItemName;
        this.byItemColor = byItemColor;
        this.itemIcon = itemIcon;
        GameBean.L_PLAYER_ID = lPlayerID;
        GameBean.L_CMD_GOODS_SLOTKEY = lItemSlotkeyID;
        GameBean.BY_CMD_COLUMN_TYPE = 1;
        sdetailTitle = "查看物品";
        MainLogic.getInstance().send(Constant.MSG_NET_CMD_CHECK_ITEM, Constant.SOCKET_MSG_TYPE_LOGIC);
    }

    /**
     * 查看宠物
     */
    public void checkPet(long lPlayerID, long lItemSlotkeyID) {
        sdetailTitle = "查看宠物";
        GameBean.L_PLAYER_ID = lPlayerID;
        GameBean.L_CMD_PET_SLOTKEY = lItemSlotkeyID;
        MainLogic.getInstance().send(Constant.MSG_NET_CMD_CHECK_PET, Constant.SOCKET_MSG_TYPE_LOGIC);
    }

    public void openCheckPet(String sPetDetail, byte byGrowthRate) {
        this.byCheckType = 4;
        this.byItemColor = byGrowthRate;
        this.sGoodsDesc = sPetDetail;
        //#if NOKIA_S60V5
         this.shHeight = (short) (Tools.getParagraphHeight(sPetDetail, 318, Constant.FONT_SMALL_HEIGHT + 2) + 40);
        //#else
//#        this.shHeight = (short) (Tools.getParagraphHeight(sPetDetail, 250, Constant.FONT_SMALL_HEIGHT + 2) + 30);
        //#endif
        this.initCheckItem();
    }

    /**
     * 查看玩家摊位的物品
     * @param sItemName
     * @param byItemColor
     * @param itemIcon
     * @param lPlayerID
     * @param byColumnIndex   摊位物品的索引
     */
    public void checkStallItem(String sItemName, byte byItemColor, Image itemIcon, long lPlayerID, byte byColumnIndex) {
        this.sItemName = sItemName;
        this.byItemColor = byItemColor;
        this.itemIcon = itemIcon;
        GameBean.L_PLAYER_ID = lPlayerID;
        GameBean.I_CMD_COLUMN_INDEX = byColumnIndex;
        GameBean.BY_CMD_COLUMN_TYPE = 3;
        sdetailTitle = "查看物品";
        MainLogic.getInstance().send(Constant.MSG_NET_CMD_CHECK_ITEM, Constant.SOCKET_MSG_TYPE_LOGIC);
    }

    /**
     * 通过物品的ID查看物品
     * @param lItemsID 
     */
    public void checkItem(String sItemName, byte byItemColor, Image itemIcon, long lPlayerID, byte byEquipPos) {
        this.sItemName = sItemName;
        this.byItemColor = byItemColor;
        this.itemIcon = itemIcon;
        GameBean.b_WAIT_NET_MSG_BACK = true;
        GameBean.L_PLAYER_ID = lPlayerID;
        GameBean.BY_CMD_EQUIP_PLACE = byEquipPos;
        GameBean.BY_CMD_COLUMN_TYPE = 2;
        MainLogic.getInstance().send(Constant.MSG_NET_CMD_CHECK_ITEM, Constant.SOCKET_MSG_TYPE_LOGIC);
    }

    /**
     * 通过物品的可以查看物品
     * @param sItemsKey 
     */
    public void checkStoreItem(String sItemName, byte byItemColor, Image itemIcon, String sItemsKey) {
        this.sItemName = sItemName;
        this.byItemColor = byItemColor;
        this.itemIcon = itemIcon;
        GameBean.b_WAIT_NET_MSG_BACK = true;
        GameBean.STR_CDM_GOODS_KEY = sItemsKey;
        MainLogic.getInstance().send(Constant.MSG_NET_CMD_CHECK_STORE_ITEM, Constant.SOCKET_MSG_TYPE_LOGIC);
    }

    /**
     * 对比装备
     * @param sItemName
     * @param byItemColor
     * @param itemIcon 
     */
    public void checkDiffItem(String sItemName, byte byItemColor, Image itemIcon) {
        this.sItemName = sItemName;
        this.byItemColor = byItemColor;
        this.itemIcon = itemIcon;
        sdetailTitle = "装备对比";
    }

    /**
     * 卸下或是装备装备
     */
    public void checkUNLoadEquip(String sItemName, byte byItemColor, Image itemIcon, byte byType) {
        this.sItemName = sItemName;
        this.byItemColor = byItemColor;
        this.itemIcon = itemIcon;
        switch (byType) {
            case 1:
                sdetailTitle = "装备道具";
                break;
            case 2:
                sdetailTitle = "卸载道具";
                break;
        }
    }

    /**
     * 打开查看物品
     * @param sGoodsDetail
     * @param sGoodsDesc
     * @param bShowHole
     * @param byHoleNum
     * @param byGemNum 
     */
    public void openCheckItem(String[] sGoodsDetail, String sGoodsDesc, boolean bShowHole, byte byHoleNum, byte byGemNum) {
        this.byCheckType = 1;
        this.bShowHole = bShowHole;
        this.byHoleNum = byHoleNum;
        this.byGemNum = byGemNum;
        this.sGoodsDetail = sGoodsDetail;
        this.sGoodsDesc = sGoodsDesc;
        this.byDetailPageIndex = 1;
        //#if NOKIA_S60V5
         this.iTotalLine = this.sGoodsDetail.length + Tools.ceil(Tools.getParagraphHeight(sGoodsDesc, 302, Constant.FONT_SMALL_HEIGHT), Constant.FONT_SMALL_HEIGHT);
         this.byMaxDetailPage = (byte) (Tools.ceil(this.iTotalLine, BY_LINE_PER_PAGE));
         if (this.byMaxDetailPage > 1) {
             this.shHeight = (short) (70 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
         } else {
             this.shHeight = (short) (70 + this.iTotalLine * Constant.FONT_SMALL_HEIGHT);
         }
        //#else
//#        this.iTotalLine = this.sGoodsDetail.length + Tools.ceil(Tools.getParagraphHeight(sGoodsDesc, 216, Constant.FONT_SMALL_HEIGHT), Constant.FONT_SMALL_HEIGHT);
//#        this.byMaxDetailPage = (byte) (Tools.ceil(this.iTotalLine, BY_LINE_PER_PAGE));
//#        if (this.byMaxDetailPage > 1) {
//#            this.shHeight = (short) (60 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#        } else {
//#            this.shHeight = (short) (60 + this.iTotalLine * Constant.FONT_SMALL_HEIGHT);
//#        }
        //#endif
        this.initCheckItem();
    }

    public void openDiffEquip(int[] iAttributeValue, short[] shStrength, String[] sGem) {
        this.byCheckType = 2;
        GameBean.b_WAIT_NET_MSG_BACK = false;
        if (iAttributeValue == null) {
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "两件装备完全一样!");
            return;
        }
        byte[] byBaseAttribute = new byte[]{6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
        byte[] byOtherAttribute = new byte[]{0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29};
        this.byPopUpState = 1;
        int totalNum = iAttributeValue.length / 3;
        int m = 0;
        int n = 0;
        for (byte i = 0; i < totalNum; i++) {
            if (Tools.inArray((byte) iAttributeValue[3 * i], byBaseAttribute) != -1) {
                m++;
            } else if (Tools.inArray((byte) iAttributeValue[3 * i], byOtherAttribute) != -1) {
                n++;
            }
        }
        this.iTotalLine = m + n + 2;
        if (shStrength[0] != 0 || shStrength[3] != 0) {
            this.iTotalLine += 6;
        } else {
            this.iTotalLine += 4;
        }
        this.sGoodsDetail = new String[iTotalLine * 3];
        this.shGemStart = (short) (m + n);
        if (m > 0) {
            this.sGoodsDetail[0] = "<h基础属性";
            this.sGoodsDetail[1] = "<d查看装备";
            this.sGoodsDetail[2] = "<d当前装备";
            this.shGemStart += 1;
        } else {
            m = -1;
        }
        if (n > 0) {
            sGoodsDetail[(m + 1) * 3] = "<h其他属性";
            sGoodsDetail[(m + 1) * 3 + 1] = "";
            sGoodsDetail[(m + 1) * 3 + 2] = "";
            this.shGemStart += 1;
        } else {
            n = -1;
        }
        sGoodsDetail[(m + n + 2) * 3] = "<h镶嵌宝石";
        sGoodsDetail[(m + n + 2) * 3 + 1] = "";
        sGoodsDetail[(m + n + 2) * 3 + 2] = "";
        this.shGemStart += 1;
        sGoodsDetail[(m + n + 2) * 3 + 3] = "";
        sGoodsDetail[(m + n + 2) * 3 + 4] = sGem[0];
        sGoodsDetail[(m + n + 2) * 3 + 5] = sGem[3];

        sGoodsDetail[(m + n + 2) * 3 + 6] = "";
        sGoodsDetail[(m + n + 2) * 3 + 7] = sGem[1];
        sGoodsDetail[(m + n + 2) * 3 + 8] = sGem[4];

        sGoodsDetail[(m + n + 2) * 3 + 9] = "";
        sGoodsDetail[(m + n + 2) * 3 + 10] = sGem[2];
        sGoodsDetail[(m + n + 2) * 3 + 11] = sGem[5];

        if (shStrength[0] != 0 || shStrength[3] != 0) {
            sGoodsDetail[(m + n + 6) * 3] = "<h强化等级";
            sGoodsDetail[(m + n + 6) * 3 + 1] = "+" + String.valueOf(shStrength[0]);
            sGoodsDetail[(m + n + 6) * 3 + 2] = "+" + String.valueOf(shStrength[3]);
            ;
            if (shStrength[1] == 1) {
                sGoodsDetail[(m + n + 6) * 3 + 3] = "攻击加成";
            } else {
                sGoodsDetail[(m + n + 6) * 3 + 3] = "防御加成";
            }
            sGoodsDetail[(m + n + 6) * 3 + 4] = "+" + String.valueOf(shStrength[2]);
            sGoodsDetail[(m + n + 6) * 3 + 5] = "+" + String.valueOf(shStrength[5]);
        }
        int k = 1;
        int p = 1;
        for (byte i = 0; i < totalNum; i++) {
            if (Tools.inArray((byte) iAttributeValue[3 * i], byBaseAttribute) != -1) {
                this.sGoodsDetail[k * 3] = Tools.getEquipAttributeNick((byte) iAttributeValue[3 * i]);
                this.sGoodsDetail[k * 3 + 1] = (iAttributeValue[3 * i + 1] >= 0 ? "+" : "-") + String.valueOf(Math.abs(iAttributeValue[3 * i + 1]));
                this.sGoodsDetail[k * 3 + 2] = (iAttributeValue[3 * i + 2] >= 0 ? "+" : "-") + String.valueOf(Math.abs(iAttributeValue[3 * i + 2]));
                k++;
            } else if (Tools.inArray((byte) iAttributeValue[3 * i], byOtherAttribute) != -1) {
                sGoodsDetail[(m + 1) * 3 + p * 3] = Tools.getEquipAttributeNick((byte) iAttributeValue[3 * i]);
                sGoodsDetail[(m + 1) * 3 + p * 3 + 1] = (iAttributeValue[3 * i + 1] >= 0 ? "+" : "-") + String.valueOf(Math.abs(iAttributeValue[3 * i + 1]));
                sGoodsDetail[(m + 1) * 3 + p * 3 + 2] = (iAttributeValue[3 * i + 2] >= 0 ? "+" : "-") + String.valueOf(Math.abs(iAttributeValue[3 * i + 2]));
                p++;
            }
        }
        this.byMaxDetailPage = (byte) Tools.ceil(iTotalLine, BY_LINE_PER_PAGE);
        this.byMaxDetailPage = (byte) Math.max(this.byMaxDetailPage, 1);
        //#if NOKIA_S60V5
         if (this.byMaxDetailPage > 1) {
             this.shHeight = (short) (90 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
         } else {
             this.shHeight = (short) (90 + iTotalLine * Constant.FONT_SMALL_HEIGHT);
         }
        //#else
//#        if (this.byMaxDetailPage > 1) {
//#            this.shHeight = (short) (70 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#        } else {
//#            this.shHeight = (short) (70 + iTotalLine * Constant.FONT_SMALL_HEIGHT);
//#        }
        //#endif
        this.byDetailPageIndex = 1;
        Tools.clearEquipAttributeArray();
        byBaseAttribute = null;
        byOtherAttribute = null;
        this.initCheckItem();
    }

    /**
     * 打开装备装备卸载
     * @param sGoodsDetail 
     */
    public void openUNloadEquip(String[] sGoodsDetail) {
        if (sGoodsDetail == null || sGoodsDetail.length < 1) {
            this.clearCheckItem();
            this.showMessage("提示", "两件装备完全一样");
            return;
        }
        this.byCheckType = 3;
        this.byPopUpState = 1;
        this.sGoodsDetail = sGoodsDetail;
        this.byDetailPageIndex = 1;
        this.iTotalLine = sGoodsDetail.length;
        this.byMaxDetailPage = (byte) (Tools.ceil(this.iTotalLine, BY_LINE_PER_PAGE));
        //#if NOKIA_S60V5
         if (this.byMaxDetailPage > 1) {
             this.shHeight = (short) (70 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
         } else {
             this.shHeight = (short) (70 + iTotalLine * Constant.FONT_SMALL_HEIGHT);
         }
        //#else
//#        if (this.byMaxDetailPage > 1) {
//#            this.shHeight = (short) (60 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#        } else {
//#            this.shHeight = (short) (60 + iTotalLine * Constant.FONT_SMALL_HEIGHT);
//#        }
        //#endif
        this.initCheckItem();
    }

    public void initCheckItem() {
        GameBean.b_WAIT_NET_MSG_BACK = false;
        this.bShowCheckItem = true;
        switch (this.byCheckType) {
            case 1:
                if (this.bShowHole && this.byGemNum > -1) {
                    switch (this.byHoleNum) {
                        case 1:
                            switch (this.byGemNum) {
                                case 1:
                                    byHoleState = new byte[]{2, 0, 0};
                                    break;
                                default:
                                    byHoleState = new byte[]{1, 0, 0};
                                    break;
                            }
                            break;
                        case 2:
                            switch (this.byGemNum) {
                                case 1:
                                    byHoleState = new byte[]{2, 1, 0};
                                    break;
                                case 2:
                                    byHoleState = new byte[]{2, 2, 0};
                                    break;
                                default:
                                    byHoleState = new byte[]{1, 1, 0};
                                    break;
                            }
                            break;
                        case 3:
                            switch (this.byGemNum) {
                                case 1:
                                    byHoleState = new byte[]{2, 1, 1};
                                    break;
                                case 2:
                                    byHoleState = new byte[]{2, 2, 1};
                                    break;
                                case 3:
                                    byHoleState = new byte[]{2, 2, 2};
                                    break;
                                default:
                                    byHoleState = new byte[]{1, 1, 1};
                                    break;
                            }
                            break;
                        default:
                            this.byHoleState = new byte[]{0, 0, 0};
                            break;

                    }
                } else {
                    bShowHole = false;
                    this.byHoleState = null;
                }
                break;
            case 2:
                break;
            case 3:
                break;
            case 4:
                break;
        }
        //#if NOKIA_S60V5
         this.shWidth = 318;
         this.detailImg = new Image[10];
        //#else
//#        this.shWidth = 232;
//#        this.detailImg = new Image[9];
        //#endif
        try {
            //弹出层的图片数组
            this.detailImg[0] = Tools.makeTransparent(ResManager.createImage(90000051), 220);
            //透明度
            this.detailImg[1] = Tools.makeTransparent(this.shWidth, 20, 220, 0x989898);
            this.detailImg[2] = ResManager.createImage(90000044);//白色确定
            if (this.byCheckType != 4) {
                this.detailImg[3] = Goods.createGoodsBg((byte) 1);//物品格子背景
                this.detailImg[4] = ResManager.createImage(90000047);//大数字
                this.detailImg[6] = ResManager.createImage(1180);//宝石图片
                this.detailImg[7] = Tools.makeTransparent(28, 28, 140, 0xFFFFFF);
                this.detailImg[8] = ResManager.createImage(90000041);//箭头
            } else {
                this.detailImg[3] = ResManager.createImage(90000049);//星星
            }
            //#if NOKIA_S60V5
             this.detailImg[9] = Tools.makeTransparent(ResManager.createImage(90000087), 220);
            //#endif
        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
        }
        //#if NOKIA_S40V3 || NORMAL_240_400 || MOTO || K790
//#         this.byPopUpState = 4;
        //#else
        this.byPopUpState = 1;
        //#endif
    }

    public void updateCheckItem() {
        //装备物品
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false) || MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false) || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false) || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
            this.bShowCheckItem = false;
            this.clearCheckItem();
        } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            if (this.byDetailPageIndex > 1) {
                this.byDetailPageIndex = (byte) (this.byDetailPageIndex - 1);
            }
        } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            if (this.byDetailPageIndex < this.byMaxDetailPage) {
                this.byDetailPageIndex = (byte) (this.byDetailPageIndex + 1);
            }
        }
        MainCanvas.clearInput();
    }

    public void drawCheckItem(Graphics g) {
        int startX = Constant.UI_START_X + ((Constant.DRAW_WIDTH - this.shWidth) >> 1);
        int startY;
        int end;
        //#if NOKIA_S60V5
         startY = Constant.UI_START_Y + ((Constant.END_LINE - this.shHeight) >> 1);
        //#else
//#        startY = Constant.UI_START_Y + ((Constant.DRAW_HEIGHT - this.shHeight) >> 1);
        //#endif
        switch (this.byCheckType) {
            case 1:
                //绘制弹出层,查看物品
                Tools.drawRoundRect(g, detailImg[0], detailImg[1], (byte) 2, this.shWidth, shHeight, startX, startY);
                //绘制打孔
                if (this.bShowHole) {
                    int iItemsH;
                    //#if NOKIA_S60V5
                     iItemsH = 35;
                    //#else
//#                    iItemsH = 35;
                    //#endif
                    int iHoleStartX = startX + this.shWidth - iItemsH * 3 - 10;

                    //#if NOKIA_S60V5
                     //绘制图片
                     Tools.drawS60V5ItemBg(g, this.detailImg[3], this.detailImg[9], this.byItemColor, startX + 10, startY + 8);
                     g.drawImage(this.itemIcon, startX + 16, startY + 14, 0);
                     //               Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 54, startY + 8);
                     Tools.drawParagraph(g, startX + 54, startY + 8, iHoleStartX - startX - 54, this.sItemName, Goods.getGoodsNameColor(byItemColor), Constant.FONT_SMALL_HEIGHT, -1);
                    //#else
//#                    //绘制图片
//#                    Tools.drawItemBg(g, this.detailImg[3], this.byItemColor, startX + 10, startY + 8);
//#                    g.drawImage(this.itemIcon, startX + 11, startY + 9, 0);
//#                    Tools.drawParagraph(g, startX + 45, startY + 8, iHoleStartX - startX - 45, this.sItemName, Goods.getGoodsNameColor(byItemColor), Constant.FONT_SMALL_HEIGHT, -1);
//#//                    Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 45, startY + 8);
                    //#endif

                    for (byte i = 0; i < 3; i++) {
                        Tools.drawItemBg(g, this.detailImg[3], (byte) -1, iHoleStartX + i * iItemsH, startY + 8);
                        Tools.setColor(g, 0xFFFFFF);
                        switch (this.byHoleState[i]) {
                            case 0:
                                break;
                            case 1:
                                g.drawImage(this.detailImg[6], iHoleStartX + 1 + i * iItemsH, startY + 9, 0);
                                g.drawImage(this.detailImg[7], iHoleStartX + 1 + i * iItemsH, startY + 9, 0);
                                break;
                            case 2:
                                g.drawImage(this.detailImg[6], iHoleStartX + 1 + i * iItemsH, startY + 9, 0);
                                break;
                        }
                    }
                } else {
                    //#if NOKIA_S60V5
                     //绘制图片
                     Tools.drawS60V5ItemBg(g, this.detailImg[3], this.detailImg[9], this.byItemColor, startX + 10, startY + 8);
                     g.drawImage(this.itemIcon, startX + 16, startY + 14, 0);
                     Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 54, startY + 8);
                    //#else
//#                    //绘制图片
//#                    Tools.drawItemBg(g, this.detailImg[3], this.byItemColor, startX + 10, startY + 8);
//#                    g.drawImage(this.itemIcon, startX + 11, startY + 9, 0);
//#                    Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 45, startY + 8);
                    //#endif
                }
                //判断是否有滚动条
                if (this.byMaxDetailPage > 1) {
                    //#if NOKIA_S60V5
                     if (this.byDetailPageIndex == 1) {
                         Tools.drawArrow(g, this.detailImg[8], (byte) 3, startX + ((this.shWidth - 7) >> 1), startY + 55);
                         Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 7) >> 1), startY + 55 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                     } else if (byDetailPageIndex == byMaxDetailPage) {
                         Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 7) >> 1), startY + 55);
                         Tools.drawArrow(g, this.detailImg[8], (byte) 4, startX + ((this.shWidth - 7) >> 1), startY + 55 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                     } else {
                         Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 7) >> 1), startY + 55);
                         Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 7) >> 1), startY + 55 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                     }
                    //#else
//#                    if (this.byDetailPageIndex == 1) {
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 3, startX + ((this.shWidth - 7) >> 1), startY + 45);
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 7) >> 1), startY + 45 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#                    } else if (byDetailPageIndex == byMaxDetailPage) {
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 7) >> 1), startY + 45);
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 4, startX + ((this.shWidth - 7) >> 1), startY + 45 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#                    } else {
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 7) >> 1), startY + 45);
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 7) >> 1), startY + 45 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#                    }
                    //#endif
                }
                byte bySelectIndex = (byte) ((byDetailPageIndex - 1) * BY_LINE_PER_PAGE);
                end = (byte) (bySelectIndex + BY_LINE_PER_PAGE > this.sGoodsDetail.length ? this.sGoodsDetail.length : bySelectIndex + BY_LINE_PER_PAGE);
                int separatorCharAt = -1;
                //#if NOKIA_S60V5
                 startY = startY + 60;
                //#else
//#                startY = startY + 50;
                //#endif
                short j = 0;
                String strOne = null;
                String strTwo = null;
                Tools.setColor(g, 0xFFFFFF);
                for (short i = bySelectIndex; i < end; i++) {
                    separatorCharAt = sGoodsDetail[i].indexOf(':');
                    if (separatorCharAt > -1) {
                        strOne = sGoodsDetail[i].substring(0, separatorCharAt + 1);
                        strTwo = sGoodsDetail[i].substring(separatorCharAt + 1);
                        Tools.drawColorString(g, strOne, 0xFFFFFF, startX + 8, startY + j * Constant.FONT_SMALL_HEIGHT);
                        if (strTwo != null && !"".equals(strTwo)) {
                            g.drawString(strTwo, startX + this.shWidth - 16 - Constant.FONT_SMALL.stringWidth(strTwo), startY + j * Constant.FONT_SMALL_HEIGHT, 0);
                        }
                    } else {
                        Tools.drawColorString(g, sGoodsDetail[i], 0xFFFFFF, startX + 8, startY + j * Constant.FONT_SMALL_HEIGHT);
                    }
                    j++;
                }
                if (byDetailPageIndex < byMaxDetailPage || (byDetailPageIndex == byMaxDetailPage && this.iTotalLine >= (byDetailPageIndex - 1) * BY_LINE_PER_PAGE)) {
                    Tools.drawParagraph(g, startX + 8, startY + j * Constant.FONT_SMALL_HEIGHT, this.shWidth - 16, sGoodsDesc, 0xFFFFFF, Constant.FONT_SMALL_HEIGHT, -1, startY + j * Constant.FONT_SMALL_HEIGHT, (BY_LINE_PER_PAGE - j) * Constant.FONT_SMALL_HEIGHT);
                } else {
                    Tools.drawParagraph(g, startX + 8, startY + j * Constant.FONT_SMALL_HEIGHT - (BY_LINE_PER_PAGE - ((byDetailPageIndex - 1) * BY_LINE_PER_PAGE - this.iTotalLine)) * Constant.FONT_SMALL_HEIGHT, this.shWidth - 16, this.sGoodsDesc, 0xFFFFFF, Constant.FONT_SMALL_HEIGHT, -1, startY + j * Constant.FONT_SMALL_HEIGHT, (BY_LINE_PER_PAGE - j) * Constant.FONT_SMALL_HEIGHT);
                }
                break;
            case 2:
                //绘制对比
                //绘制图片
                //#if NOKIA_S60V5
                 Tools.drawPopUp(g, (byte) 4, startX, startY, this.shWidth, this.shHeight, this.detailImg[0], this.detailImg[1], (byte) 2, this.detailImg[2], 22, 0, 21, 10, this.detailImg[2], 0, 0, 22, 10, this.sdetailTitle, null);
                 Tools.drawS60V5ItemBg(g, this.detailImg[3], this.detailImg[9], this.byItemColor, startX + 10, startY + 30);
                 g.drawImage(this.itemIcon, startX + 16, startY + 36, 0);
                 Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 55, startY + 36);
                //#else
//#                Tools.drawPopUp(g, (byte) 4, startX, startY, this.shWidth, this.shHeight, this.detailImg[0], this.detailImg[1], (byte) 2, this.detailImg[2], 0, 0, 22, 10, this.detailImg[2], 22, 0, 21, 10, this.sdetailTitle, null);
//#                Tools.drawItemBg(g, this.detailImg[3], this.byItemColor, startX + 10, startY + 20);
//#                g.drawImage(this.itemIcon, startX + 11, startY + 21, 0);
//#                Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 45, startY + 23);
                //#endif

                //判断是否有滚动条
                if (this.byMaxDetailPage > 1) {
                    //#if NOKIA_S60V5
                     //箭头类型(蓝色:1左2右3上4下,白色:5左6右7上8下,灰色：9左10右,11上,12下)
                     Tools.drawArrow(g, this.detailImg[8], this.byDetailPageIndex == 1 ? (byte) 11 : (byte) 3, startX + ((this.shWidth - 7) >> 1), startY + 65);
                     Tools.drawArrow(g, this.detailImg[8], this.byDetailPageIndex == byMaxDetailPage ? (byte) 12 : (byte) 4, startX + ((this.shWidth - 7) >> 1), startY + 70 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                    //#else
//#                    Tools.drawArrow(g, this.detailImg[8], this.byDetailPageIndex == 1 ? (byte) 11 : (byte) 2, startX + ((this.shWidth - 7) >> 1), startY + 55);
//#                    Tools.drawArrow(g, this.detailImg[8], this.byDetailPageIndex == byMaxDetailPage ? (byte) 12 : (byte) 4, startX + ((this.shWidth - 7) >> 1), startY + 60 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                    //#endif
                }

                int start = (byDetailPageIndex - 1) * BY_LINE_PER_PAGE;
                end = start + BY_LINE_PER_PAGE > this.iTotalLine ? this.iTotalLine : start + BY_LINE_PER_PAGE;
                //#if NOKIA_S60V5
                 startY = startY + 70;
                //#else
//#                startY = startY + 60;
                //#endif
                j = 1;
                for (int i = start; i < end; i++) {
                    if (!Tools.isOdd(i)) {
                        g.setColor(0x777777);
                        g.fillRect(startX + 3, startY + (i - (this.byDetailPageIndex - 1) * BY_LINE_PER_PAGE) * Constant.FONT_SMALL_HEIGHT, this.shWidth - 6, Constant.FONT_SMALL_HEIGHT);
                    }
                    Tools.drawColorString(g, this.sGoodsDetail[3 * i], 0xFFFFFF, 0x000000, startX + 8, startY + (i - (this.byDetailPageIndex - 1) * BY_LINE_PER_PAGE) * Constant.FONT_SMALL_HEIGHT, g.LEFT | g.TOP);
                    if (i >= this.shGemStart && i < this.shGemStart + 3) {
                        Tools.drawColorString(g, sGoodsDetail[i * 3 + 1], 0xFFFFFF, 0x000000, startX + 8, startY + (i - (this.byDetailPageIndex - 1) * BY_LINE_PER_PAGE) * Constant.FONT_SMALL_HEIGHT, g.LEFT | g.TOP);
                        Tools.drawColorString(g, sGoodsDetail[i * 3 + 2], 0xFFFFFF, 0x000000, startX + this.shWidth - 8, startY + (i - (this.byDetailPageIndex - 1) * BY_LINE_PER_PAGE) * Constant.FONT_SMALL_HEIGHT, g.RIGHT | g.TOP);
                    } else {
                        Tools.drawColorString(g, sGoodsDetail[i * 3 + 1], 0xFFFFFF, 0x000000, startX + ((this.shWidth - Constant.FONT_SMALL.stringWidth(sGoodsDetail[i * 3 + 1])) >> 1) + 15, startY + (i - (this.byDetailPageIndex - 1) * BY_LINE_PER_PAGE) * Constant.FONT_SMALL_HEIGHT, g.LEFT | g.TOP);
                        Tools.drawColorString(g, sGoodsDetail[i * 3 + 2], 0xFFFFFF, 0x000000, startX + this.shWidth - 8, startY + (i - (this.byDetailPageIndex - 1) * BY_LINE_PER_PAGE) * Constant.FONT_SMALL_HEIGHT, g.RIGHT | g.TOP);
                    }
                    j++;
                }
                break;
            case 3:
                //装备，卸载
                Tools.drawRoundRect(g, detailImg[0], detailImg[1], (byte) 2, this.shWidth, shHeight, startX, startY);
                //绘制图片
                //#if NOKIA_S60V5
                 Tools.drawS60V5ItemBg(g, this.detailImg[3], this.detailImg[9], this.byItemColor, startX + 10, startY + 8);
                 g.drawImage(this.itemIcon, startX + 16, startY + 14, 0);
                 Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 55, startY + 10);
                //#else
//#                Tools.drawItemBg(g, this.detailImg[3], this.byItemColor, startX + 10, startY + 20);
//#                g.drawImage(this.itemIcon, startX + 11, startY + 21, 0);
//#                Goods.drawGoodsName(g, this.byItemColor, this.sItemName, startX + 45, startY + 22);
                //#endif
                //绘制图片
                Tools.setColor(g, 0xFFFFFF);
                //判断是否有滚动条
                if (byMaxDetailPage > 1) {
                    //#if NOKIA_S60V5
                     if (byDetailPageIndex == 1) {
                         Tools.drawArrow(g, this.detailImg[8], (byte) 3, startX + ((this.shWidth - 5) >> 1), startY + 55);
                         Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 5) >> 1), startY + 55 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                     } else if (byMaxDetailPage == byDetailPageIndex) {
                         Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 5) >> 1), startY + 55);
                         Tools.drawArrow(g, this.detailImg[8], (byte) 4, startX + ((this.shWidth - 5) >> 1), startY + 55 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                     } else {
                         Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 5) >> 1), startY + 55);
                         Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 5) >> 1), startY + 55 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
                     }
                    //#else
//#                    if (byDetailPageIndex == 1) {
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 3, startX + ((this.shWidth - 5) >> 1), startY + 45);
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 5) >> 1), startY + 45 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#                    } else if (byMaxDetailPage == byDetailPageIndex) {
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 5) >> 1), startY + 45);
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 4, startX + ((this.shWidth - 5) >> 1), startY + 45 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#                    } else {
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 7, startX + ((this.shWidth - 5) >> 1), startY + 45);
//#                        Tools.drawArrow(g, this.detailImg[8], (byte) 8, startX + ((this.shWidth - 5) >> 1), startY + 45 + BY_LINE_PER_PAGE * Constant.FONT_SMALL_HEIGHT);
//#                    }
                    //#endif
                }
                bySelectIndex = (byte) ((byDetailPageIndex - 1) * BY_LINE_PER_PAGE);
                end = bySelectIndex + BY_LINE_PER_PAGE > this.iTotalLine ? this.iTotalLine : bySelectIndex + BY_LINE_PER_PAGE;
                separatorCharAt = -1;
                //#if NOKIA_S60V5
                 startY = startY + 60;
                //#else
//#                startY = startY + 50;
                //#endif
                j = 0;
                strOne = null;
                strTwo = null;
                Tools.setColor(g, 0xFFFFFF);
                for (short i = bySelectIndex; i < end; i++) {
                    separatorCharAt = sGoodsDetail[i].indexOf(':');
                    if (separatorCharAt > -1) {
                        strOne = sGoodsDetail[i].substring(0, separatorCharAt + 1);
                        strTwo = sGoodsDetail[i].substring(separatorCharAt + 1);
                        Tools.drawColorString(g, strOne, 0xFFFFFF, startX + 8, startY + j * Constant.FONT_SMALL_HEIGHT);
                        if (strTwo != null && strTwo.length() > 1) {
                            g.drawString(strTwo, startX + this.shWidth - 8 - Constant.FONT_SMALL.stringWidth(strTwo), startY + j * Constant.FONT_SMALL_HEIGHT, 0);
                        }
                    } else {
                        Tools.drawColorString(g, sGoodsDetail[i], 0xFFFFFF, startX + 8, startY + j * Constant.FONT_SMALL_HEIGHT);
                    }
                    j++;
                }
                break;
            case 4:
                //#if NOKIA_S60V5
                 Tools.drawPopUp(g, (byte) 4, Constant.UI_START_X + (Constant.DRAW_WIDTH - 318 >> 1), Constant.UI_START_Y + ((Constant.END_LINE - this.shHeight) >> 1), 318, this.shHeight, this.detailImg[0], 0x9c9c9c, this.detailImg[2], 22, 0, 21, 10, this.detailImg[2], 0, 0, 22, 10, this.sdetailTitle, null);
                 Tools.drawParagraph(g, Constant.UI_START_X + 71, Constant.UI_START_Y + ((Constant.END_LINE - this.shHeight) >> 1) + 37, 230, sGoodsDesc, 0xFFFFFF, Constant.FONT_SMALL_HEIGHT + 2, 0x000000);
                 for (byte i = 0; i <= this.byItemColor; i++) {
                     g.drawImage(this.detailImg[3], Constant.UI_START_X + (Constant.DRAW_WIDTH - 318 >> 1) + 50 + i * 15, Constant.UI_START_Y + ((Constant.END_LINE - this.shHeight) >> 1) + 37 + 3 * (Constant.FONT_SMALL_HEIGHT + 2), 0);
                 }
                //#else
//#                Tools.drawPopUp(g, (byte) 4, Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1), Constant.UI_START_Y + ((Constant.DRAW_HEIGHT - this.shHeight) >> 1), 232, this.shHeight, this.detailImg[0], 0x989898, this.detailImg[2], 0, 0, 22, 10, this.detailImg[2], 22, 0, 21, 10, this.sdetailTitle, null);
//#
//#                Tools.drawParagraph(g, Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 26, Constant.UI_START_Y + ((Constant.DRAW_HEIGHT - this.shHeight) >> 1) + 25, 198, sGoodsDesc, 0xFFFFFF, Constant.FONT_SMALL_HEIGHT + 2, 0x000000);
//#
//#                for (byte i = 0; i <= this.byItemColor; i++) {
//#                    g.drawImage(this.detailImg[3], Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 26 + i * 15, Constant.UI_START_Y + ((Constant.DRAW_HEIGHT - this.shHeight) >> 1) + 25 + 3 * (Constant.FONT_SMALL_HEIGHT + 2), 0);
//#                }
                //#endif
                break;
        }
    }

    public void clearCheckItem() {
        this.sGoodsDesc = null;
        this.sGoodsDetail = null;
        this.detailImg = null;
        this.bShowCheckItem = false;
        this.sItemName = null;
        this.itemIcon = null;
        this.sdetailTitle = null;
    }
    /*****************引导开始*******************/
    private String sGuide;
    private String sGuideTitle = null;
    public static boolean bShowGuide = false;
    public static int saveStateGuide;
    private String[][] guide;
    public static int[][] StateGuide = {{-1, -1}};
    public static boolean isStateGuide;
    private Image[] imgArrayGuide;
    public String getGuideGoodKey;
    public long getNpcID, getGuideGoodColumnKey;

    public void initGuide(String title, int titlenum, int stateGuide) {
        this.guide = new String[][]{
            {//0
                "欢迎来到神羿世界！小女子名叫水岚，正在用传音入密从很远的地方和您说话。您刚刚从一场大病中恢复，还需要一些必要的训练才能彻底痊愈。现在就<b练习走路>，然后尽快找到小女子的真身吧。点击屏幕移动，现在就试试吧。（向下走找到水岚。）",//0
                "您看到小女子了吗？头顶红色叹号的就是啊。赶快来到小女子的身边领取第一个任务吧。（头顶<b红色叹号>的NPC表示有<b可接任务>，头顶<b红色问号>的NPC表示有<b已完成并可交还的任务>。）",//1
            },
            {//1
                "人物每升一级都会得到两个可以<b自由分配>的<b属性点>，需要您进入<b人物属性界面>手动完成<b加点操作>。路径为：功能菜单=>角色=>属性。",//0
                "",//1
                "",//2
                "角色有五个属性，分别为<b臂力、体魄、气力、灵敏及悟性>。它们决定了角色的其他各方面数值。其中<b体魄对武师的影响很大，灵敏对刺客影响很大，而臂力对术士影响很大>。",//3
                "<b悟性值>会影响到角色的<b修为值获取速度>，悟性值越高，每次战斗中获取的修为值则越高。角色在学习技能及打通经脉时会使用到修为值。",//4
                "点击选择想要变更的<b属性点>，点击屏幕左右两边进行点数的加减操作。现在就试试吧。",//5
            },//
            {//2
                "您可以在<b任务界面>中使用<b自动寻路功能>快速的到达任务目标地点。路径为：功能菜单=>任务。或者直接点击任务按钮打开任务界面使用自动寻路功能。",//8
                "在想要完成的任务上点击确认按钮，在弹出的菜单中选择<b“自动寻路”>即可。现在就试试吧。",//9
                "",//10
                "",//11
                "靠近并按<b确认>选中目标，<b目标>可以进行<b目标的切换>。选中目标后，可以按<b确认>进行<b普通攻击>，或者按相应的<b快捷键>使用<b技能>攻击。",//12
            },//
            {//3
                "装备只有穿到身上才能发挥应有的作用。小女子这就为您展示穿装的过程。",//0
                "",//1
                "点击弹出菜单中的<b“装备”>，即可将装备穿在身上了。",//2
                "",//3
                "",//4
                "您可以在<b角色界面>中<b查看>并<b卸下>装备。",//5
                "",//6
                "",//7
                "您可以在这里查看身上的装备或者将它们卸下。",//8
            },//
            {//4
                "",//
                "",//
            },//
            {//5
                "您刚刚获得了一枚<b宠物蛋>，现在就打开它看看您的宠物是什么样子的吧。",//0
                "",//1
                "点击您的<b宠物蛋>，在弹出的菜单中选择<b“使用”>，就能获得您的第一个宠物了。",//2
                "",//3
                "",//4
                "宠物具有很多不同的技能，可以增强您的各项属性，但是只有装备到身上才能够发挥出它应有的作用。现在就将您的第一只宠物装备到身上吧。",//5
                "",//6
                "",//7
                "",//8
                "",//9
                "宠物必须设置成<b守护状态>才能够出现在您身边，点击<b“确认”>，在弹出的菜单中选择<b“守护”>就能够在漫游界面看到您的宠物了。现在就试试看吧。",//10
                "",//11
                "",//12
            },//
            {//6
                "您刚刚获得了一本<b技能书>，使用它就可以学到非常强大的<b技能>了。现在就来学习你的第一个技能吧。",//0
                "",//1
                "点击您获得的<b技能书>，在弹出的菜单中选择<b“学习”>，即可学习到您的第一个技能。",//2
                "",//3
                "",//4
                "您可以将常用的技能或物品设置到<b快捷键>上，在战斗中只要点击相应的快捷键就快速地可以施放技能或者使用物品了。小女子这就为您展示设置快捷键的方法。",//5
                "",//6
                "",//7
                "点击相应的快捷栏位，在弹出的菜单中选择技能或者物品，然后在技能页面或背包页面中点击相应的技能或者物品，即可完成快捷键的设置。",//8
            },//
            {//7
                "点击<b菜单>，选择“<b*聊天>”，即可进入<b聊天界面>。",//0
                "",//1
                "",//2
                "选择<b相应频道>，点击确认即可进入<b编辑信息页面>。编辑完成后，点击确定即可发送信息，点击右软件在弹出的菜单中选择“返回”，即可退出编辑。",//3
                "小女子接着为您展示添加好友的操作方法：在<b漫游界面>下点击<b菜单>进入功能菜单，选择<b“社交”>选项下的<b“好友”>选项，即可进入<b好友页面>。",//4
                "",//5
                "",//6
                "点击添加好友，在弹出的界面中填入<b玩家名称>，再次点击确认，即可添加该玩家为好友。现在就试试添加<bGM001>为好友吧。",//7
                "",//8
            },//
            {//8
                "您身上的装备会在战斗中逐渐<b磨损>，使<b耐久度>降低。如果不幸<b阵亡.，全部装备的耐久度都会<b降低10%>，一旦装备的耐久度<b降低到0>，则装备提供的<b属性加成变为无效>，必须进行<b修理>才能够<b恢复>装备的耐久度。",//
                "您可以找到<b名称后面带有“（修）”字样的NPC>选择<b“修理”>功能恢复磨损装备的耐久度，修理需要花费一定量的金钱，耐久度越低花费的金钱越多。",//
                "当您的角色不幸<b死亡>时，可以选择<b原地复活>或者<b回城复活>，选择原地复活角色会在<b原地满血满蓝复活>，但是需要角色携带有<b还魂丹>，每次原地复活都会<b消耗一个还魂丹>。还魂丹可以在<b商城>购买到。",//
                "选择<b回城复活>，您的角色会被<b传送到复活点>复活。<b未达到16级>的角色死亡之后可以<b免费原地复活>。",//
            },//
            {//9
                "您可以使用<b任务传送功能>快速的传送到任务目标所在地。任务传送需要消耗<b传送石>，每次进行任务传送时都要<b消耗一颗传送石>。传送石可以在<b商城>购买到。小女子这就为您展示如何进行任务传送。",//0
                "",//1
                "在想要完成的任务上面点击确认，在弹出的菜单中选择<b“传送”>，即可完成。",//2
                "",//3
                "",//4
                "<b技能>通过<b购买技能书>然后<b学习>获得，您可以在<b技能商人>处购买到各个职业的技能书以及通用技能书。学习技能需要消耗<b修为值>。购买到技能书后，打开背包点击技能书选择使用即可完成技能的学习。现在就购买您的第二个职业技能书吧。购买完毕别忘了学习哦~",//5
                "",//6
            },//
            {//10
                "",//
                "",//
            },//
            {//11
                "您现在可以打通自己的<b经脉>增强各项属性了。打通经脉需要消耗<b修为值>。杀怪过程中会得到修为值。修为值的获取与人物属性中的<b悟性值>有很大关系，悟性值越高，则获取修为值速度越快。经脉分为<b基本、冰、火、毒三系>。除基本经脉以外，一旦选中<b冰火毒三系>其中一系打通经脉后，打通其余两系所需的修为值会变得更高。",//
                "",//1
                "",//2
                "您可以在这里打通角色的经脉，<b带颜色的经脉>表示<b现在可以打通的经脉>，<b白色>表示<b暂不能打通该经脉>。点击具体经脉可以查看<b该经脉的详情>或者<b打通该经脉>。",//3
            },//
            {//12
                "您可以通过游戏中的<b邮箱>进行<b收发邮件>的操作。您可以在收件箱中查收其他玩家给您发送的信件，也可以在发件箱中编辑信件发送给其他玩家。邮件中可以<b附加金钱及物品>。",//0
                "点击相应的信件可以<b查看信件详情>。",//1
                "",//2
                "",//3
                "您可以在这里查看信件的详细内容，并收取信件中的<b附件>。",//4
                "",//5
                "下面为你继续介绍如何发邮件",//6
                "您可以在这里编辑新的信件发送给其他玩家。信件中可以附加金钱及物品。",//7
                "",//8
                "",//9
            },//
            {//13
                "技能都是可以<b升级>的，您可以在<b技能商人>处购买到以学习技能的<b高级版本技能书>，点击学习后即可将您的技能升级。",//
                "",//
            },//
            {//14
                "<b宠物>具有<b快乐度>，快乐度<b上限>为100，初始快乐度为100，<b每分钟降低1点>。快乐度<b降低到20以下>时，宠物会被<b收起>，不能继续<b守护>玩家。给宠物<b喂食>可以恢复宠物的快乐度。",//0
                "",//1
                "",//2
                "<b食草类宠物>需要使用<b百花草>喂食，<b食肉类宠物>需要用<b蜘蛛肉.喂食，而<b杂食类宠物>则需用<b万灵香>来喂食。<b宠物食品>在<b药品商人>处出售。",//3
            },//
            {//15
                "您可以在<b宠物界面>里对宠物进行<b合成操作>。小女子这就为您展示宠物合成的步骤。",//0
                "",//1
                "",//2
                "不同的宠物可以直接合成，合成需要一个<b主宠>和一个<b副宠>。<b绑定的宠物不能处于副宠位置>。合成后，<b副宠身上的技能有一定几率合成到主宠身上>。如果副宠身上有多个技能，则<b随机抽取一个技能>合成。",//3
                "合成时，如果主宠身上没有多余的空技能格，则如果合成成功，副宠的技能<b随机覆盖>掉一个主宠身上的技能。您可以利用<b【金玉环】锁定>主宠的某个技能，<b被锁定的技能不会被覆盖掉>。无论副宠身上的技能是什么级别，合成后，该技能自动变成1级。<b合成只能合成技能，不能保留技能等级>。合成之后，副宠消失。",//4
                "设置好<b主宠和副宠>之后，点击下方的<b“合成”>按钮即可完成宠物合成操作。",//5
                "",//6
            },//
            {//16
                "您可以在<b宠物界面>中进行<b潜能激发操作>。潜能激发可以提高宠物的各方面属性，需要<b消耗潜能石头>，同时提升宠物的<b潜能点数.。宠物<b初始的潜能为0/80>。每个宠物的<b潜能上限>默认为80。每激发一次潜能，则增加相应的潜能点数，当<b潜能点数到达上限>时，则<b不能继续激发潜能>。",//0
                "<b【洗髓经】>让宠物保留现有技能和潜能激发效果，同时等级变成1级，并重新分配宠物的<b成长率>。在潜能激发中喂食使用。<b【轮回石】>将宠物的当前潜能恢复为0，并保留宠物原先已经激发的潜能的效果的一半。在潜能激发中喂食使用。使用道具可以<b提升潜能上限>并<b重置潜能点数>。",//1
                "",//2
                "",//3
                "点击宠物栏位选择想要激发潜能的宠物，点击<b喂食栏位>选择<b喂食道具>，然后点击下方的<b“喂食”>按钮，即可完成潜能激发操作。",//4
            },//
            {//17
                "<b安北城>是帝国中一座了不起的城市，它镇守着帝国的北部边疆，防范着一直对帝国虎视眈眈的北疆蛮族。同时它也是北部地区经济的枢纽。您可以在这里找到许许多多的<b商人以及官员>。",//0
                "您可以找到<b技能、药品以及装备商人>购买物品，还可以找到<b强化大师>对装备进行强化，或者找到<b宝石大师>为装备打孔、镶嵌宝石，或者找到<b合成大师>合成装备或拆解装备。您可以找到<b套装兑换使者>兑换套装部件，也可以将手中的<b帮派徽记>兑换成代币。",//1
                "当您达到20级时，可以找到<b帮派管理员>建立帮派，加入帮派后，就可以在<b25级和35级>时参与紧张刺激的<b帮战活动>。您在这里还可以找到发布各种丰富活动的<b活动大使>，为除魔勇士降福的<b七公主>。",//2
            },//
            {//18
                "您可以将<b背包>中暂时不用的物品寄存到自己的<b私人仓库>中去。寄存物品只要找到<b仓库管理员>然后点击“仓库”按钮，将背包中的物品存到仓库里面即可。",//
                "",//
            },//
            {//19
                "您可以找到<b合成大师>对无用的装备进行<b拆解操作>。除白色装备及一些特殊装备无法被拆解外，其余的装备都可以被拆解。已经<b打孔、强化或者镶嵌>的装备无法被拆解。拆解时必须保证背包中<b至少要留有三个栏位>，否则无法拆解。装备拆解后有一定几率获得<b龙睛、追星、凤瞳或者相应的龙睛、追星、凤瞳碎片>。",//0
                "将需要被拆解的物品放置在<b拆解栏位>，然后点击下方的<b“开始分解”>，即可将装备拆解掉。",//1
                "",//2
            },//
            {//20
                "您可以找到合成大师将龙睛、追星或者凤瞳碎片合成为龙睛、追星或者凤瞳。10追星碎片=1追星；10凤瞳碎片=1凤瞳；10龙睛碎片=1龙睛。龙睛、追星和凤瞳为装备兑换代币。",//0
                "将足够的碎片放置在合成栏位上，然后点击下方的<b“开始合成”>按钮，即可将碎片合成。",//1
            },//
            {//21
                "您可以找到<b套装兑换使者>将手中的龙睛、凤瞳或者追星兑换成<b本职业>的<b高级蓝色套装>。",//0
                "",//1
            },//
            {//22
                "您可以用手中的<b白虎、灵猴或者苍鹰套装>和兑换来的<b青龙、云光、金霞套装>中的<b同一位置的部件>进行<b合成>，得到<b神龙、电光、慕月套装的相应部件>。合成后的装备为<b紫装>，是神羿世界中相当强力的装备。以此类推，当您<b达到足够的级别>就可以用<b代币>在套装兑换使者那里兑换<b高等级的蓝装>，然后和身上的<b低级别套装部件>进行<b合成>，以便得到<b更高等级的紫色套装>。",//0
                "将需要合成的物品分别放置在相应的合成栏位上，然后点击下方的<b“开始合成”>按钮，即可合成新的装备。",//1
            },//
            {//23
                "您可以找到<b强化大师>对装备进行<b强化操作>。<b装备最高可以强化到9级>。强化只针对<b武器、上衣、裤子、头盔和鞋>五个位置。项链、戒指等饰品类装备无法进行强化。装备<b强化成功与否具有一定几率>，可以使用<b几率宝石>来提高强化成功率。强化宝石最多可以放4个，也可以不放。<b强化1-9级分别需要花费1-9个强化石>。如，由无强化强化到+1等级需要1颗强化石，而由+8等级强化到+9等级则需要9颗强化石。",//0
                "将需要强化的物品放置在强化栏位上，设定好其他宝石，然后点击下方的<b“开始强化”>按钮，即可完成强化操作。",//1
            },//
            {//24
                "您可以找到<b宝石大师>对装备进行<b打孔、镶嵌以及拆卸操作>。每件装备<b最多打3个孔>。打第一个孔花费1银，第二个孔花费5银，第三个孔花费10银。<b每次打孔需消耗一个对应打孔装备品质的打孔石>。如绿色装备打孔时需要消耗绿色打孔石，紫色装备打孔时需要消耗紫色打孔石。<b每种宝石的镶嵌位置不同》。如攻击水晶只能镶嵌在武器上。<b拆卸下来的宝石等级会下降一级，1级宝石拆卸后会消失>。使用<b【拆卸保护石】>，拆卸下来的宝石<b不会降等级>，但是该宝石会与你<b绑定>。",//0
                "将需要打孔或者镶嵌或者拆卸的装备放置在<b装备栏位>上，然后选择下面的<b孔位>，点击确定后<b选择相应功能>即可完成操作。",//1
            },//
            {//25
                "记得每次升级的时候都要将得到的<b属性点>分配到各项属性上去，否则会举步维艰的。现在可以适当的增加<b悟性值>了。悟性值会影响到角色的<b修为值获取速度>，悟性值越高，每次战斗中获取的修为值则越高。角色在<b学习技能>及<b打通经脉>时会使用到修为值。一旦您觉得属性点分配不恰当，可以在<b商城>中购买<b洗点卡>，使用后会将您分配的属性点全部退还给您，允许您<b重新分配>。",//0
                "",//1
                "",//2
            },//
            {//26
                "您可以在<b安北城>找到<b帮派管理员>建立<b帮派>了。建立帮派需要花费1金币，同时需要您在<b商城>中购买一个<b建帮令牌>。当您准备好足够的物品，就可以点击帮派管理员选择“建立帮派”选项，进入到<b建帮界面>。",//0
                "设置好<b帮派名称>、<b帮派代号>以及<b帮派宣言>，然后点击下方的<b“建立帮派”>按钮，即可完成建帮操作。",//1
                "建立帮派后，您可以通过<b帮派管理员>传送到<b帮址>中，在帮址中您可以完成<b帮派升级>、<b购买帮派特殊物品>以及<b帮派技能>等操作。当您达到25级或35级时，还可以参与紧张刺激的<b帮派战场活动>。",//2
            },//
            {//27
                "您现在可以进行<bPK>了。进行PK之前需要先将您的<bPK状态>设置为<b开启>。",//0
                "",//1
                "",//2
                "点击将<bPK状态>设置为<b开启>。",//3
                "",//4
                "您可以在<b非安全区域>与高于20级的玩家进行PK。PK会增加<bPK值>，当PK值大于0时，角色名称变为黄色，当PK值大于30时，角色名称变为红色。<b恶意PK有惩罚>，当红名角色被击杀时可能会<b随机掉落>身上的一件<b非绑定>的装备，因此建议您使用<b装备绑定符>将身上的装备绑定。",//5
            },//
        };

        this.sGuideTitle = title;
        this.sGuide = this.guide[titlenum][stateGuide];
        this.StateGuide[0][0] = titlenum;
        this.StateGuide[0][1] = stateGuide;
        this.byKeyState = -1;

        Guide_CurrentPage = 0;
        getParagraphPage(this.sGuide, Guide_RectW - 10, Constant.FONT_SMALL.getHeight(), Guide_RectH - 10);
        if (Guide_TotalPage > 0) {
            isPage = true;
        } else {
            isPage = false;
        }
        if (this.sGuide != null && this.sGuide.length() > 0) {
            iTextHeight = Tools.getParagraphHeight(sGuide, Guide_RectW - 10, Constant.FONT_SMALL_HEIGHT);
        }
        try {
            this.imgArrayGuide = new Image[5];
            //#if NOKIA_S40V3 || NORMAL_240_400 || MOTO || K790
            //#else
            this.imgArrayGuide[0] = ResManager.getImage(Constant.RES_UI_PATH + "90000115.png", 9999);
            imgArrayGuide[1] = Tools.makeTransparent(Constant.SCREEN_WIDTH, 10, 100, 0x252525);//半透明背景图片
            imgArrayGuide[2] = ResManager.createImage(90000043);//文字图片
            imgArrayGuide[3] = ResManager.createImage(90000090);//方向
            imgArrayGuide[4] = ResManager.createImage(90000086);//底部蓝条
            //#endif
            bShowGuide = true;
        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
//            System.out.print("弹出层图片载入异常");
        }
    }
    //
    //一段文字分页
//    public String str = "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            + "一二三四五六七八九十一二三四五六七八九十"
//            ;
    public static String[] str_Guide = new String[1];
    private static int Guide_CurrentPage, Guide_TotalPage;
    public static boolean isPage;
    public static int getTaskList_Y;

    public void getParagraphPage(String text, int rowWidth, int rowHeight, int textHeight) {
        if (text == null) {
            return;
        }
        str_Guide = new String[10];
        if (rowHeight < Constant.FONT_SMALL_HEIGHT) {
            rowHeight = Constant.FONT_SMALL_HEIGHT;
        }
        int length = text.length();
        char tempChar;
        int tempLength = 0;
        int iStartX = 0;
        int iStartY = Constant.FONT_SMALL_HEIGHT;
        int height = 0;
        int page = 0;
        int Charposition = 0;
        for (int i = 0; i < length; i++) {
            tempChar = text.charAt(i);
            if (tempChar == '<') {
                if (i == length - 1) {
                    break;
                }
                tempChar = text.charAt(i + 1);
                i += 1;
            } else if (tempChar == '>') {
//                color = fontColor;
//                g.setColor(fontColor);
            } else if (tempChar == '#') {
                tempLength = 0;
                iStartX = 0;
                iStartY = iStartY + rowHeight;
                if (iStartY > textHeight) {
                    str_Guide[page] = text.substring(Charposition, i);
                    Charposition = i;
                    page++;
                    iStartY = Constant.FONT_SMALL_HEIGHT;
                }
            } else {
                if (tempLength + Constant.FONT_SMALL.charWidth(tempChar) > rowWidth) {
                    iStartY = iStartY + rowHeight;
                    iStartX = 0;
                    tempLength = 0;
                    if (iStartY > textHeight) {
                        str_Guide[page] = text.substring(Charposition, i);
                        Charposition = i;
                        page++;
                        iStartY = Constant.FONT_SMALL_HEIGHT;
                    }
                }
                tempLength = tempLength + Constant.FONT_SMALL.charWidth(tempChar);
                iStartX = iStartX + Constant.FONT_SMALL.charWidth(tempChar);
                str_Guide[page] = text.substring(Charposition, i + 1);
            }
        }
        Guide_TotalPage = page;
//        System.out.println("Guide_TotalPage  :: " + Guide_TotalPage);
//        for (int i = 0; i < str_Guide.length; i++) {
//            Tools.printLog(i + "  i ::   " + str_Guide[i]);
//        }
    }
    //
    public static int POS_X2 = 0;
    public static int POS_Y2 = 0;
    public static int iCountIndex = 0;
    public int Guide_RectH = 100, Guide_RectW = 200;
    public int iTextHeight;
    public static boolean initWaiting;

    public void drawGuide(Graphics g) {
//        Tools.drawPopUp(g, (byte) 4,
//                this.sGuideiStartX, this.sGuideiStartY,
//                this.sGuideiWidth, this.sGuideiHeight,
//                imgArrayGuide[0], imgArrayGuide[1],
//                (byte) 1, imgArrayGuide[2], 0, 0, 22, 10, imgArrayGuide[2], 22, 0, 21, 10,
//                this.sGuideTitle, this.sGuide);
        //#if NOKIA_S60V5
         Tools.drawTilePic(g, (byte) 2, Constant.UI_START_X, Constant.UI_START_Y, Constant.DRAW_HEIGHT, imgArrayGuide[1], 0, 0, Constant.DRAW_WIDTH,
                 imgArrayGuide[1].getHeight(), Constant.TRANS_NONE);
         Tools.drawBottom(g, imgArrayGuide[2], imgArrayGuide[3], imgArrayGuide[4]);
        //#endif
        //#if NOKIA_S40V3 || NORMAL_240_400 || MOTO || K790
        //#else
        if (imgArrayGuide[0] != null) {
            iCountIndex += 1;
            if (iCountIndex > 1000) {
                iCountIndex = 0;
            }
            POS_X2 = (Constant.SCREEN_WIDTH - Guide_RectW) / 2 + Guide_RectW - 74;
            POS_Y2 = (Constant.SCREEN_HEIGHT - 124 - Guide_RectH) / 2;
            g.setClip(POS_X2, POS_Y2, 76, 84);//头
            g.drawImage(imgArrayGuide[0], POS_X2, POS_Y2 - 10, 0);
            g.setClip(POS_X2 + 22, POS_Y2 + 59, 26, 10);//眼睛
            g.drawImage(imgArrayGuide[0], POS_X2 - (((iCountIndex % 30) == 0) ? 0 : 27) + 22, POS_Y2 + 59, 0);
            g.setClip(POS_X2 - 11, POS_Y2 + 84, 45, 52);//左边身子
            g.drawImage(imgArrayGuide[0], POS_X2 - 11, POS_Y2 - 11, 0);
            g.setClip(POS_X2 - 11 + 45, POS_Y2 + 84, 6, 52);//中间身子
            g.drawImage(imgArrayGuide[0], POS_X2 - 11 - 1, POS_Y2 - 11, 0);
            g.setClip(POS_X2 - 11 + 45 + 6, POS_Y2 + 84, 45, 52);//右边身子
            g.drawRegion(imgArrayGuide[0], 0, 95, 45, 52, Constant.TRANS_MIRROR, POS_X2 - 11 + 45 + 6, POS_Y2 + 84, 0); //右上角
        }
        //#endif
        g.setClip((Constant.SCREEN_WIDTH - Guide_RectW) / 2,
                (Constant.SCREEN_HEIGHT - 124 - Guide_RectH) / 2 + 124, Guide_RectW, Guide_RectH);
        Tools.drawRectBox(g, (Constant.SCREEN_WIDTH - Guide_RectW) / 2,
                (Constant.SCREEN_HEIGHT - 124 - Guide_RectH) / 2 + 124, Guide_RectW, Guide_RectH, 0xfbffe8, 0x847065);
//        Tools.drawRectBox(g, (Constant.SCREEN_WIDTH - Guide_RectW) / 2,
//                (Constant.SCREEN_HEIGHT - 124 - Guide_RectH) / 2 + 124, Guide_RectW, Guide_RectH, 0x2392b7, 0x847065);
        Tools.drawParagraph(g, (Constant.SCREEN_WIDTH - Guide_RectW) / 2 + 5,
                (Constant.SCREEN_HEIGHT - 124 - Guide_RectH) / 2 + 5 + 124,
                Guide_RectW - 10,
                str_Guide[Guide_CurrentPage], 0x000000, Constant.FONT_SMALL.getHeight(), -1);
//                        Tools.drawHCycleRollingParagraph(g, this.sGuide,
//                                iTextHeight,
//                                Guide_RectW - 10,
//                                Guide_RectH - 10,
//                                Constant.FONT_SMALL.getHeight(),
//                                (Constant.SCREEN_WIDTH - Guide_RectW) / 2 + 5,
//                                (Constant.SCREEN_HEIGHT - 124 - Guide_RectH) / 2 + 5 + 124,
//                                0xffffff, 0x000000);
        g.setClip(0, 0, Constant.SCREEN_WIDTH, Constant.SCREEN_HEIGHT);
    }

    public void initSysGuidefinish() {
        switch (this.StateGuide[0][0]) {
            case 1: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 1;
                        this.StateGuide[0][1] = 1;
                        break;
                }

                break;
            }
            case 2: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 2;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 3: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 3;
                        this.StateGuide[0][1] = 1;
                        break;
                    case 5:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 3;
                        this.StateGuide[0][1] = 6;
                        break;

                }
                break;
            }
            case 5: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 5;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 6: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 6;
                        this.StateGuide[0][1] = 1;
                        break;
                    case 5:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 6;
                        this.StateGuide[0][1] = 6;
                        break;
                }
                break;
            }
            case 7: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 7;
                        this.StateGuide[0][1] = 2;
                        break;
                    case 4:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 7;
                        this.StateGuide[0][1] = 5;
                        break;
                }
                break;
            }
            case 8: {
                switch (this.StateGuide[0][1]) {
                }
                break;
            }
            case 9: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 9;
                        this.StateGuide[0][1] = 1;
                        break;
                    case 5:
//                        System.out.println("7777777777777777777777777777777");
                        MainLogic.getInstance().uiInterFace.store.lockPlayerSkillBook();
                        break;
                }
                break;
            }
            case 11: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 11;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 12: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        MainLogic.getInstance().uiEquipment.ReceiveEmail_index = 0;
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 1);
                        this.StateGuide[0][0] = 12;
                        this.StateGuide[0][1] = 1;
                        break;
                    case 6:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 7);
                        this.StateGuide[0][0] = 12;
                        this.StateGuide[0][1] = 7;
                        break;
                }
                break;
            }
            case 13: {
                switch (this.StateGuide[0][1]) {
                }
                break;
            }
            case 14: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 14;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 15: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 15;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 16: {
                switch (this.StateGuide[0][1]) {
                    case 1:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 16;
                        this.StateGuide[0][1] = 2;
                        break;
                }
                break;
            }
            case 17: {
                switch (this.StateGuide[0][1]) {
                }
                break;
            }
            case 18: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        GameBean.L_NPC_ID = getNpcID;
                        GameBean.b_WAIT_NET_MSG_BACK = true;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_DEPOT, Constant.SOCKET_MSG_TYPE_LOGIC);
                        break;
                }
                break;
            }
            case 19: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 19, 1);
                        this.StateGuide[0][0] = 19;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 20: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 20, 1);
                        this.StateGuide[0][0] = 20;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 21: {
                switch (this.StateGuide[0][1]) {
                }
                break;
            }
            case 22: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 22, 1);
                        this.StateGuide[0][0] = 22;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 23: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 23, 1);
                        this.StateGuide[0][0] = 23;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 24: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 24, 1);
                        this.StateGuide[0][0] = 24;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 25: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 25;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 26: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 26, 1);
                        this.StateGuide[0][0] = 26;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 27: {
                switch (this.StateGuide[0][1]) {
                    case 0:
                        //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        this.StateGuide[0][0] = 27;
                        this.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
        }
    }

    public void updateGuide() {
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {
            this.byKeyState = 0; //取消
            if (this.byNextUiState > -1) {
                MainLogic.getInstance().pushState(this.byNextUiState, true);
            }
            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
            this.clearGuide();
        }
        if (isPage) {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                Guide_CurrentPage++;
                if (Guide_CurrentPage >= Guide_TotalPage) {
                    Guide_CurrentPage = Guide_TotalPage;
                    isPage = false;
                }
            }
        } else {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                //提示框按键
                this.byKeyState = 0; //取消
                if (this.byNextUiState > -1) {
                    MainLogic.getInstance().pushState(this.byNextUiState, true);
                }
                MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
                this.clearGuide();
                initWaiting = true;
                switch (this.StateGuide[0][0]) {
                    case 1: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 2);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 1;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 3:
                                initGuide("引导", 1, 4);
                                this.StateGuide[0][0] = 1;
                                this.StateGuide[0][1] = 4;
                                break;
                            case 4:
                                initGuide("引导", 1, 5);
                                this.StateGuide[0][0] = 1;
                                this.StateGuide[0][1] = 5;
                                break;
                        }

                        break;
                    }
                    case 2: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 4);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 2;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 1:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(30,MainLogic.getInstance().uiInterFace.npcTalk.iPositionY - 25, Constant.SCREEN_WIDTH-60, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(30, MainLogic.getInstance().uiInterFace.npcTalk.iPositionY - 30, Constant.SCREEN_WIDTH - 60, 28);
                                //#else
//#//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//#                                initDrawRect(30, MainLogic.getInstance().uiInterFace.npcTalk.iPositionY - 25, Constant.SCREEN_WIDTH - 60, 23);
                                //#endif
                                this.StateGuide[0][0] = 2;
                                this.StateGuide[0][1] = 2;
                                break;
                        }
                        break;
                    }
                    case 3: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 5);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 3;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 2:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                                //#else
//#                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                                //#endif
                                MainLogic.uiPackage.lockPackageItems(getGuideGoodKey);
//                                System.out.println("装备" + getGuideGoodKey);
                                this.StateGuide[0][0] = 3;
                                this.StateGuide[0][1] = 3;
                                break;
                            case 5:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 2);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 3;
//                                this.StateGuide[0][1] = 6;
                                break;

                        }
                        break;
                    }
                    case 5: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 5);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 5;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 2:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                                //#else
//#                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                                //#endif
                                MainLogic.uiPackage.lockPackageItems(getGuideGoodKey);
//                                System.out.println("装备" + getGuideGoodKey);
                                this.StateGuide[0][0] = 5;
                                this.StateGuide[0][1] = 3;
                                break;
                            case 5:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                                //#else
//#                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                                //#endif
                                MainLogic.uiPackage.lockPackageItems(getGuideGoodKey);
                                this.StateGuide[0][0] = 5;
                                this.StateGuide[0][1] = 6;
                                break;
                            case 10:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                                //#else
//#                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                                //#endif
                                MainLogic.getInstance().uiInterFace.pet.lockPet(getGuideGoodColumnKey);
                                this.StateGuide[0][0] = 5;
                                this.StateGuide[0][1] = 11;
                                break;
                        }
                        break;
                    }
                    case 6: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 5);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 6;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 2:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                                //#else
//#                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                                //#endif
                                MainLogic.uiPackage.lockPackageItems(getGuideGoodKey);
//                                System.out.println("装备" + getGuideGoodKey);
                                this.StateGuide[0][0] = 6;
                                this.StateGuide[0][1] = 3;
                                break;
                            case 5:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 9);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 6;
//                                this.StateGuide[0][1] = 6;
                                break;
                        }
                        break;
                    }
                    case 7: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 10);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 7;
//                                this.StateGuide[0][1] = 2;
                                break;
                            case 3:
                                initGuide("引导", 7, 4);
                                this.StateGuide[0][0] = 7;
                                this.StateGuide[0][1] = 4;
                                break;
                            case 4:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 8);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 7;
//                                this.StateGuide[0][1] = 5;
                                break;
                            case 7:
//                                isStateGuide = true;
//                                isDrawRect = true;
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
//                            initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
////#                                 initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 7;
//                                this.StateGuide[0][1] = 8;
//                                MainLogic.uiInterFace.friend.bySubSelectIndex = 1;
//                                MainLogic.uiInterFace.friend.bySelectIndex = 2;
//                                //#if NOKIA_S60V5
//                            MainLogic.uiInterFace.friend.iPositionY = Constant.UI_START_Y + (41 << 1);
//                                //#else
////#                                 MainLogic.uiInterFace.friend.iPositionY = Constant.UI_START_Y + 65;
//                                //#endif
                                break;
                        }
                        break;
                    }
                    case 8: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 8, 1);
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 8;
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 1;
                                break;
                            case 2:
                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 8, 3);
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 8;
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                                break;
                        }
                        break;
                    }
                    case 9: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 4);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 9;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 2:
                                this.StateGuide[0][0] = 9;
                                this.StateGuide[0][1] = 3;
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(30,MainLogic.getInstance().uiInterFace.npcTalk.iPositionY - 25, Constant.SCREEN_WIDTH-60, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(30, MainLogic.getInstance().uiInterFace.npcTalk.iPositionY - 30, Constant.SCREEN_WIDTH - 60, 28);
                                //#else
//#//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//#                                initDrawRect(30, MainLogic.getInstance().uiInterFace.npcTalk.iPositionY - 25, Constant.SCREEN_WIDTH - 60, 23);
                                //#endif
                                break;
                            case 5:
                                GameBean.b_WAIT_NET_MSG_BACK = true;
                                GameBean.L_NPC_ID = getNpcID;
                                MainLogic.getInstance().uiInterFace.store.lNpcID = getNpcID;
                                //打开普通的npc商店
                                GameBean.BY_OP_TYPE = 1;
                                Tools.printLog("发送购买东西");
                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_NPC_STORE, Constant.SOCKET_MSG_TYPE_LOGIC);
//                                MainLogic.getInstance().uiInterFace.store.lockPlayerSkillBook();
                                break;
                        }
                        break;
                    }
                    case 11: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 3);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 11;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 12: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                GameBean.b_WAIT_NET_MSG_BACK = true;
                                MainLogic.getInstance().uiEquipment.Opeartion_type = 7;
                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
//                                MainLogic.getInstance().uiEquipment.ReceiveEmail_index = 0;
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 1);
//                                this.StateGuide[0][0] = 12;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 1:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_E72
//#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                                //#elif NOKIA_S60V5
                                 initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                                //#else
//#                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                                //#endif
                                this.StateGuide[0][0] = 12;
                                this.StateGuide[0][1] = 2;
                                break;
                            case 4:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_S60V5
                                 initDrawRect(5, 41, Constant.FONT_SMALL.stringWidth("收取附件") + 10, 23);
                                //#else
//#                                initDrawRect(5, 21, Constant.FONT_SMALL.stringWidth("收取附件") + 10, 23);
                                //#endif
                                this.StateGuide[0][0] = 12;
                                this.StateGuide[0][1] = 5;
                                break;
                            case 6:
                                MainLogic.getInstance().uiEquipment.initSendMail();
                                MainLogic.getInstance().pushState(Constant.GAME_UI_SEND_EMAIL, true);
                                Constant.CMD_MAIL_TYPE = 0;
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 7);
//                                this.StateGuide[0][0] = 12;
//                                this.StateGuide[0][1] = 7;
                                break;
                        }
                        break;
                    }
                    case 13: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                GameBean.b_WAIT_NET_MSG_BACK = true;
                                GameBean.L_NPC_ID = getNpcID;
                                MainLogic.getInstance().uiInterFace.store.lNpcID = getNpcID;
                                //打开普通的npc商店
                                GameBean.BY_OP_TYPE = 1;
                                Tools.printLog("发送购买东西");
                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_NPC_STORE, Constant.SOCKET_MSG_TYPE_LOGIC);
                                MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                                break;
                        }
                        break;
                    }
                    case 14: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 6);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 14;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 15: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 6);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 15;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 3:
                                this.StateGuide[0][0] = 15;
                                this.StateGuide[0][1] = 4;
                                initGuide("引导", 15, 4);
                                break;
                            case 4:
                                this.StateGuide[0][0] = 15;
                                this.StateGuide[0][1] = 5;
                                initGuide("引导", 15, 5);
                                break;
                        }
                        break;
                    }
                    case 16: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                initGuide("引导", 16, 1);
                                this.StateGuide[0][0] = 16;
                                this.StateGuide[0][1] = 1;
                                break;
                            case 1:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 6);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 16;
//                                this.StateGuide[0][1] = 2;
                                break;
                        }
                        break;
                    }
                    case 17: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 17, 1);
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 17;
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 1;
                                break;
                            case 1:
                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 17, 2);
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 17;
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                                break;
                        }
                        break;
                    }
                    case 18: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                GameBean.L_NPC_ID = getNpcID;
                                GameBean.b_WAIT_NET_MSG_BACK = true;
                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_DEPOT, Constant.SOCKET_MSG_TYPE_LOGIC);
                                break;
                        }
                        break;
                    }
                    case 19: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().pushState(Constant.GAME_UI_ITEMS_DECOMPOSE, true);
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 19, 1);
//                                this.StateGuide[0][0] = 19;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 20: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().pushState(Constant.GAME_UI_ITEMS_COMPOSE, true);
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 20, 1);
//                                this.StateGuide[0][0] = 20;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 21: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                //牌子兑换
                                //购买东西
                                GameBean.b_WAIT_NET_MSG_BACK = true;
                                GameBean.L_NPC_ID = getNpcID;
                                //打开普通的npc商店
                                GameBean.BY_OP_TYPE = 2;
                                Tools.printLog("发送牌子兑换东西");
                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_NPC_STORE, Constant.SOCKET_MSG_TYPE_LOGIC);
                                MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                                break;
                        }
                        break;
                    }
                    case 22: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().pushState(Constant.GAME_UI_ITEMS_COMPOSE, true);
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 22, 1);
//                                this.StateGuide[0][0] = 22;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 23: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().pushState(Constant.GAME_UI_ITEMS_STRENGTHEN, true);
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 23, 1);
//                                this.StateGuide[0][0] = 23;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 24: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().pushState(Constant.GAME_UI_EQUIP_OPERATION, true);
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 24, 1);
//                                this.StateGuide[0][0] = 24;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 25: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 2);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 25;
//                                this.StateGuide[0][1] = 1;
                                break;
                        }
                        break;
                    }
                    case 26: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                MainLogic.getInstance().pushState(Constant.GAME_UI_CREATE_TONG, true);
//                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 26, 1);
//                                this.StateGuide[0][0] = 26;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 1:
                                MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 26, 2);
                                this.StateGuide[0][0] = 26;
                                this.StateGuide[0][1] = 2;
                                break;
                        }
                        break;
                    }
                    case 27: {
                        switch (this.StateGuide[0][1]) {
                            case 0:
                                isStateGuide = true;
                                isDrawRect = true;
                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 2);
//                                //#if NOKIA_E72
////#                             initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                                //#elif NOKIA_S60V5
////#                             initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                                //#else
//                                initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                                //#endif
//                                this.StateGuide[0][0] = 27;
//                                this.StateGuide[0][1] = 1;
                                break;
                            case 3:
                                isStateGuide = true;
                                isDrawRect = true;
                                //#if NOKIA_S60V5
                                 MainLogic.getInstance().uiInterFace.property.iPositionY = Constant.UI_START_Y + Constant.END_LINE - Constant.FONT_SMALL_HEIGHT;
                                //#else
//#                                MainLogic.getInstance().uiInterFace.property.iPositionY = Constant.UI_START_Y + 21 + Constant.FONT_SMALL_HEIGHT * 10;
                                //#endif
                                initDrawRect(2, MainLogic.getInstance().uiInterFace.property.iPositionY, Constant.SCREEN_WIDTH - 4, 23);
                                this.StateGuide[0][0] = 27;
                                this.StateGuide[0][1] = 4;
                                break;
                        }
                        break;
                    }
                }
            }
        }
        MainCanvas.clearInput();
    }

    public void saveGuide(int state) {
        switch (Constant.PLAYER_INDEX) {
            case 1:
                saveStateGuide = state;
                Rms.saveGame(Constant.RMS_NEW_PLAYER_TUITION_1, null);
                break;
            case 2:
                saveStateGuide = state;
                Rms.saveGame(Constant.RMS_NEW_PLAYER_TUITION_2, null);
                break;
            case 3:
                saveStateGuide = state;
                Rms.saveGame(Constant.RMS_NEW_PLAYER_TUITION_3, null);
                break;
            case 4:
                saveStateGuide = state;
                Rms.saveGame(Constant.RMS_NEW_PLAYER_TUITION_4, null);
                break;
        }
    }

    public void clearGuide() {
        this.imgArrayGuide = null;
        this.bShowGuide = false;
        this.sGuideTitle = null;
        this.sGuide = null;
        this.guide = null;
    }
    public static boolean isDrawRect;
    public static int isDrawRect_index;
    private Image[] imgArrayRect;

    public void initDrawRect(int x, int y, int w, int h) {
        rect_x = x;
        rect_y = y;
        rect_w = w;
        rect_h = h;
        isDrawRect_index = 0;
        try {
            if (imgArrayRect == null) {
                this.imgArrayRect = new Image[1];
                imgArrayRect[0] = ResManager.createImage(90000079);
            }
        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
//            System.out.print("弹出层图片载入异常");
        }
    }
    public int rect_x, rect_y, rect_w, rect_h;
    public int cursorCenterOffsetX;

    public void drawDrawRect(Graphics g) {
        if (imgArrayRect[0] != null) {
            g.setColor(0xff0000);
            if (isDrawRect_index % 2 == 0) {
                for (int i = 0; i < 3; i++) {
                    g.drawRect(rect_x - i, rect_y - i, rect_w + i * 2, rect_h + i * 2);
                }
            }
            //#if NOKIA_S60V5
             g.drawRegion(imgArrayRect[0], 0, 0, 10, 9, Constant.TRANS_MIRROR_ROT270, rect_x - 6 - 9 - cursorCenterOffsetX, rect_y + (rect_h - 10) / 2, 0);
            //#else
//#            g.drawRegion(imgArrayRect[0], 0, 0, 10, 9, Constant.TRANS_MIRROR_ROT90, rect_x + rect_w + 6 + cursorCenterOffsetX, rect_y + (rect_h - 10) / 2, 0);
            //#endif
            isDrawRect_index++;
            cursorCenterOffsetX = (Tools.sin(isDrawRect_index << Tools.BITS + 4) >> Tools.BITS - 2);
        }
    }

    public void clearDrawRect() {
//        this.imgArrayRect = null;
        this.isDrawRect = false;
    }
    /******************引导结束******************/
    /***************系统公告*******************/
    public static boolean bShowNotice = false;
    public int Strheight;
    public byte Noticestate;
    public int iNoticeStartX, iNoticeStartY, iNoticeWidth, iNoticeHeight;
    private Image[] imgNoticeArray;

    public void initNotice(String notice, String noticeText, byte type) {//type 0有更多公告
        Strtext = noticeText;
        Noticestate = type;
        this.byKeyState = -1;
        //#if NOKIA_S60V5
         this.iNoticeStartX = 40;
         this.iNoticeStartY = 40;
        //#elif NOKIA_E72
//#         this.iNoticeStartX = 10;
//#         this.iNoticeStartY = 20;
        //#else
//#
//#        this.iNoticeStartX = 10;
//#        this.iNoticeStartY = 80;
        //#endif

        this.iNoticeWidth = Constant.SCREEN_WIDTH - this.iNoticeStartX * 2;
        //#if NOKIA_S60V5
         this.iNoticeHeight = Constant.NEW_END_LINE - this.iNoticeStartY * 2;
        //#else
//#        this.iNoticeHeight = Constant.SCREEN_HEIGHT - this.iNoticeStartY * 2;
        //#endif
        initWH();
        try {
            //弹出层的图片数组
            //#if NOKIA_S60V5
             this.imgNoticeArray = new Image[5];
             this.imgNoticeArray[0] = Tools.makeTransparent(ResManager.createImage(90000051), 255);
             //透明度
             this.imgNoticeArray[1] = Tools.makeTransparent(10, this.iNoticeHeight + this.iNoticeHeight / 10, 220, 0x989898);
             this.imgNoticeArray[2] = ResManager.createImage(90000043);
             this.imgNoticeArray[3] = ResManager.createImage(90000086);
             this.imgNoticeArray[4] = ResManager.createImage(90000090);
            //#else
//#            this.imgNoticeArray = new Image[3];
//#            this.imgNoticeArray[0] = Tools.makeTransparent(ResManager.createImage(90000051), 255);
//#            //透明度
//#            this.imgNoticeArray[1] = Tools.makeTransparent(10, this.iNoticeHeight + this.iNoticeHeight / 10, 220, 0x989898);
            //#endif
            bShowNotice = true;

        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
//            System.out.print("弹出层图片载入异常");
        }
    }
    public int str_y;
    public int barrect_h, barrect_y;
    public int start_str_y, Angle_w;
    public int str_rect_x, str_rect_y, str_rect_w, str_rect_h;

    public void initWH() {
        //#if NOKIA_S60V5
         start_str_y = 30;
         Angle_w = 13;
        //#else
//#        start_str_y = 20;
//#        Angle_w = 7;
        //#endif
        str_rect_x = iNoticeStartX + 5;
        str_rect_y = iNoticeStartY + start_str_y;
        str_y = str_rect_y;
        barrect_y = 0;
        str_rect_w = this.iNoticeWidth - 15;
        str_rect_h = this.iNoticeHeight - Angle_w - Constant.FONT_SMALL_HEIGHT - start_str_y;
        Strheight = Tools.getParagraphHeight(Strtext, str_rect_w, Constant.FONT_SMALL_HEIGHT) + 5;

    }

    public void updateNotice() {
        barrect_h = (str_rect_h) * (str_rect_h) / (Strheight);
        if (barrect_h > str_rect_h - 2) {
            barrect_h = str_rect_h - 2;
        }
        if (str_y + Strheight == str_rect_y + str_rect_h) {
            barrect_y = str_rect_h - barrect_h - 1;
        } else {
            barrect_y = (str_rect_y - str_y) * (str_rect_h - barrect_h) / (str_rect_h);
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, true)) {
            str_y += 3;
            if (str_y > str_rect_y) {
                str_y = str_rect_y;
            }
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, true)) {
            if (Strheight > str_rect_h) {
                str_y -= 3;
                if (str_y + Strheight < str_rect_y + str_rect_h) {
                    str_y = str_rect_y + str_rect_h - Strheight;
                }
            }
        }
        if ((MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))
                && Noticestate == 0) {
            this.byKeyState = 1; //确认
            MainLogic.getInstance().send(Constant.MSG_NET_CMD_NOTICE_LIST, Constant.SOCKET_MSG_TYPE_LOGIC);
            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
            this.clearNotice();
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {
            //提示框按键
            this.byKeyState = 0; //取消
            if (this.byNextUiState > -1) {
                MainLogic.getInstance().pushState(this.byNextUiState, true);
            }
            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
            this.clearNotice();
            MainLogic.getInstance().bCanStartGuide = true;
        }
        MainCanvas.clearInput();
    }
    String Strtext;
//    String Strtext = "1一二三四五六七八九十，<k2一二三四五六七八九十，>"
//            + "<c3一二三四五六七八九十，>4一二三四五六七八九十，"
//            + "5一二三四五六七八九十，<i6一二三四五六七八九十，>"
//            + "7一二三四五六七八九十，<h8一二三四五六七八九十，>"
//            + "9一二三四五六七八九十，0一二三四五六七八九十，"
//            + "1一二三四五六七八九十，2一二三四五六七八九十，"
//            + "<b3一二三四五六七八九十，>4一二三四五六七八九十，"
//            + "5一二三四五六七八九十，6一二三四五六七八九十，"
//            + "7一二三四五六七八九十，8一二三四五六七八九十，"
//            + "9一二三四五六七八九十，0一二三四五六七八九十，"
//            + "1一二三四五六七八九十，2一二三四五六七八九十，";

    public void drawNotice(Graphics g) {
        //#if NOKIA_S60V5
         Tools.drawPopUp(g, (byte) 4, iNoticeStartX, iNoticeStartY, this.iNoticeWidth, this.iNoticeHeight, imgNoticeArray[0], 0x9c9c9c,
                 null, 0, 0, 0, 0, null, 0, 0, 0, 0,
                 "公告", null);
        //#else
//#        Tools.drawPopUp(g, (byte) 4, iNoticeStartX, iNoticeStartY, this.iNoticeWidth, this.iNoticeHeight, imgNoticeArray[0], 0x989898,
//#                null, 0, 0, 0, 0, null, 0, 0, 0, 0,
//#                "公告", null);
        //#endif
        //滚动条
        g.setColor(0xffffff);
        g.drawRect(iNoticeStartX + this.iNoticeWidth - 9, str_rect_y, 6, str_rect_h);
        g.setColor(0x000000);
        g.fillRect(iNoticeStartX + this.iNoticeWidth - 9 + 1, str_rect_y + barrect_y + 1, 4, barrect_h);
        //滚动字
        g.setClip(iNoticeStartX + 4, str_rect_y, str_rect_w, str_rect_h);
        Tools.drawParagraph(g, str_rect_x, str_y, str_rect_w, Strtext, 0x323232, Constant.FONT_SMALL_HEIGHT, 0xFFFFFF);
        g.setClip(0, 0, Constant.SCREEN_WIDTH, Constant.SCREEN_HEIGHT);
        g.setColor(0xffffff);
        //#if NOKIA_S60V5
         if (Noticestate == 0) {
             g.drawString("更多消息", iNoticeStartX + this.iNoticeWidth - 10 - Constant.FONT_SMALL.stringWidth("更多消息"), str_rect_y + str_rect_h, 0);
         }
         g.drawString("返回", str_rect_x, str_rect_y + str_rect_h, 0);
          Tools.drawBottom(g, this.imgNoticeArray[2], this.imgNoticeArray[4], imgNoticeArray[3]);
        //#else
//#        if (Noticestate == 0) {
//#            g.drawString("更多消息", str_rect_x, str_rect_y + str_rect_h, 0);
//#        }
//#        g.drawString("返回", iNoticeStartX + this.iNoticeWidth - 10 - Constant.FONT_SMALL.stringWidth("返回"), str_rect_y + str_rect_h, 0);
        //#endif

    }

    public void clearNotice() {
        bShowNotice = false;
        Strtext = null;
        Noticestate = 0;
        imgNoticeArray = null;
    }
}
